Answered step by step
Verified Expert Solution
Question
1 Approved Answer
/ This program displays a hot beverage menu and prompts the user to / / make a selection. A switch statement determines which item the
This program displays a hot beverage menu and prompts the user to
make a selection. A switch statement determines which item the user
has chosen. A dowhile loop repeats until the user selects item E
from the menu.
PLACE YOUR NAME HER
#include
#include
using namespace std;
int main
Fill in the code to define an integer variable called number,
a floating point variable called cost,
and a character variable called beverage
bool validBeverage;
cout fixed showpoint setprecision;
do
cout endl endl;
cout "Hot Beverage Menu" endl endl;
cout A: Coffee $ endl;
cout B: Tea $ endl;
cout C: Hot Chocolate $ endl;
cout D: Cappuccino $ endl endl endl;
cout "Enter the beverage ABC or D you desire" endl;
cout "Enter E to exit the program" endl endl;
Fill in the code to read in beverage
switch beverage
case a:
case A:
case b:
case B:
case c:
case C:
case d:
case D: validBeverage true;
break;
default: validBeverage false;
if validBeverage true
cout "How many cups would you like?" endl;
Fill in the code to read in number
Fill in the code to begin a switch statement
that is controlled by beverage
case a:
case A: cost number ;
cout "The total cost is $ cost endl;
break;
Fill in the code to give the case for hot chocolate $ a cup
Fill in the code to give the case for tea $ a cup
Fill in the code to give the case for cappuccino $ a cup
case e:
case E: cout Please come again" endl;
break;
default: cout Fill in the code to write a message
indicating an invalid selection.
cout Try again please" endl;
Fill in the code to finish the dowhile statement with the
condition that beverage does not equal E or e
Fill in the appropriate return statement
This program displays a hot beverage menu and prompts the user to
make a selection. A switch statement determines which item the user
has chosen. A dowhile loop repeats until the user selects item E
from the menu.
PLACE YOUR NAME HER
#include
#include
using namespace std;
int main
Fill in the code to define an integer variable called number,
a floating point variable called cost,
and a character variable called beverage
bool validBeverage;
cout fixed showpoint setprecision;
do
cout endl endl;
cout "Hot Beverage Menu" endl endl;
cout A: Coffee $ endl;
cout B: Tea $ endl;
cout C: Hot Chocolate $ endl;
cout D: Cappuccino $ endl endl endl;
cout "Enter the beverage ABC or D you desire" endl;
cout "Enter E to exit the program" endl endl;
Fill in the code to read in beverage
switch beverage
case a:
case A:
case b:
case B:
case c:
case C:
case d:
case D: validBeverage true;
break;
default: validBeverage false;
if validBeverage true
cout "How many cups would you like?" endl;
Fill in the code to read in number
Fill in the code to begin a switch statement
that is controlled by beverage
case a:
case A: cost number ;
cout "The total cost is $ cost endl;
break;
Fill in the code to give the case for hot chocolate $ a cup
Fill in the code to give the case for tea $ a cup
Fill in the code to give the case for cappuccino $ a cup
case e:
case E: cout Please come again" endl;
break;
default: cout Fill in the code to write a message
indicating an invalid selection.
cout Try again please" endl;
Fill in the code to finish the dowhile statement with the
condition that beverage does not equal E or e
Fill in the appropriate return statement
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started