case D: defauit valdeeverage = true: break valdBeverage = faise; (valdBeverage true) cout e "How many cups would you ke?" < endit Fill in the code to read in number OF MI IN Fill in the code to begin a switch statement N that is controlled by beverage case 'a: case A: cost = number * 1.0 cout e "The total cost is S< cost end; break: " Fil in the code to give the case for hot chocolate ($1.25 a cup) W Filin the code to give the case for tea ($0.75 a cup) W Filin the code to give the case for cappuccina ($2.50 a cup) case e: case 'E: cout se " Flease come again" e ena break, defauit cout e l Fill in the code to write a message W indicating an invalid selection. cout Try again please" e endl: ) } Fil in the code to finish the do-while statement with the NAD MIN

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
case D:
defaut:
valoBeverage = true,
break
valdBeverage = faise;
(valdBeverage == true)
UF
cout e "How many cups would you Nke?" << endi;
Fill in the code to read in number
I Fill in the code to begin a switch statement
N that is controlled by beverage
case a: case
A:
cost = number * 1.0
cout <e "The total cost is $<< cost e endl;
break
N Fill in the code to give the case for hot chocolate ($1.25 a cup)
N Fil in the code to give the case for tea ($0.75 a cup)
I Fil in the code to give the case for cappuccino ($2.50 a cup)
case e
cout e * Please come again" <e
end break
case 'E
defaut:
cout e Fil in the code to write a message
W indicating an invalid selection.
cout e Try again please" ee end )
W Fil in the code to finish the do-while statement with the
N condition that beverage does not equal E or e
I Fill in the appropriate return statement
1946
29
1. Fill in the indicated code to complete the above program. Then compile and run
the program several times with various inputs. Try all the possible relevant cases
and record your results. What did you realize from this exercise?
2. What do you think will happen if you do not enter A, B, C, D, or E? Try running
the program and inputting another letter.
NADS
MIN
Transcribed Image Text:case D: defaut: valoBeverage = true, break valdBeverage = faise; (valdBeverage == true) UF cout e "How many cups would you Nke?" << endi; Fill in the code to read in number I Fill in the code to begin a switch statement N that is controlled by beverage case a: case A: cost = number * 1.0 cout <e "The total cost is $<< cost e endl; break N Fill in the code to give the case for hot chocolate ($1.25 a cup) N Fil in the code to give the case for tea ($0.75 a cup) I Fil in the code to give the case for cappuccino ($2.50 a cup) case e cout e * Please come again" <e end break case 'E defaut: cout e Fil in the code to write a message W indicating an invalid selection. cout e Try again please" ee end ) W Fil in the code to finish the do-while statement with the N condition that beverage does not equal E or e I Fill in the appropriate return statement 1946 29 1. Fill in the indicated code to complete the above program. Then compile and run the program several times with various inputs. Try all the possible relevant cases and record your results. What did you realize from this exercise? 2. What do you think will happen if you do not enter A, B, C, D, or E? Try running the program and inputting another letter. NADS MIN
II This program displays a hot beverage menu and prompts the user to
Il make a selection. A switch statement determines
Il which item the user has chosen. A do-while loop repeats until
I/l the user selects item E from the menu.
#include <iostream>
#include <iomanip>
SITY OF
using namespace std;
int main()
I Fill in the code to define an integer variable called
Il number, a floating point variable called cost,
Il and a character variable called beverage
bool validBeverage;
cout <« fixed << showpoint << setprecision(2);
do
cout << endl << endi; cout << "Hot Beverage Menu"
« endi<< endl; cout << "A: Coffee $1.00" <
endi; cout<< "B: Tea S.75"<<endl; cout <« "C: Hot
Chocolate $1.25" «< endl; cout << "D: Cappuccino
$2.50" << endl << endl << endl; cout << "Enter the
beverage A,B,C, or D you desire"
« endi; cout << "Enter E to exit the program"
« endi << endl;
I/ Fill in the code to read in beverage
ITY
switch(beverage)
1946
case 'a
case 'A:
case 'b:
case 'B
case c: case
'C: case d:
AQ-
MINDANAO
Transcribed Image Text:II This program displays a hot beverage menu and prompts the user to Il make a selection. A switch statement determines Il which item the user has chosen. A do-while loop repeats until I/l the user selects item E from the menu. #include <iostream> #include <iomanip> SITY OF using namespace std; int main() I Fill in the code to define an integer variable called Il number, a floating point variable called cost, Il and a character variable called beverage bool validBeverage; cout <« fixed << showpoint << setprecision(2); do cout << endl << endi; cout << "Hot Beverage Menu" « endi<< endl; cout << "A: Coffee $1.00" < endi; cout<< "B: Tea S.75"<<endl; cout <« "C: Hot Chocolate $1.25" «< endl; cout << "D: Cappuccino $2.50" << endl << endl << endl; cout << "Enter the beverage A,B,C, or D you desire" « endi; cout << "Enter E to exit the program" « endi << endl; I/ Fill in the code to read in beverage ITY switch(beverage) 1946 case 'a case 'A: case 'b: case 'B case c: case 'C: case d: AQ- MINDANAO
Expert Solution
steps

Step by step

Solved in 3 steps with 4 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education