Problem

Complete the if statements in the following program skeleton. #include using namespac...

Complete the if statements in the following program skeleton.

#include

using namespace std;

int main()

{

const int LENGTH = 20;

char iceCream[LENGTH];

cout << "What flavor of ice cream do you like best? ";

cout << "Chocolate, Vanilla, or Pralines and Pecan? ";

cin.getline(iceCream, LENGTH);

cout << "Here is the number of fat grams for a half ";

cout << "cup serving:\n";

//

// Finish the following if-else statement

// so the program will select the ice cream entered

// by the user

//

if (/* insert your code here */)

cout << "Chocolate: 9 fat grams.\n";

else if (/* insert your code here */)

cout << "Vanilla: 10 fat grams.\n";

else if (/* insert your code here */)

cout << "Pralines and Pecan: 14 fat grams.\n";

else

cout << "That's not one of our flavors!\n";

return 0;

}

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT