Write 2 different programs using if statement and switch statement that presents the iser w/ a choice of 5 beverages (Coke, Water, Sprite, ... , and so on). Then allow the user to choose a beverage by entering a number 1-5. Dutput which beverage they chose. Sample Output: *Beverages**** 1- COKE 50 2- WATER 20 B- SPRITE 60 - ROYAL 50 5- MT.DEW Choose a beverage : tem name: ? tem price:? Amount: ? Amt. paid: 60 (assume that the amt paid is equal or higher than amount) - Change:

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 15PE
icon
Related questions
Question

Using DEV C++

Write 2 different programs using if statement and switch statement that presents the
user w/ a choice of 5 beverages (Coke, Water, Sprite, . , and so on).
Then allow the user to choose a beverage by entering a number 1-5.
Output which beverage they chose.
Sample Output:
*Beverages*
1- COKE
50
2- WATER
20
3- SPRITE
60
4- ROYAL
50
5- MT.DEW
60
Choose a beverage :
|
Item name: ?
Item price:?
Amount: ?
Amt. paid:_ (assume that the amt paid is equal or higher than amount)
-
Change:
Transcribed Image Text:Write 2 different programs using if statement and switch statement that presents the user w/ a choice of 5 beverages (Coke, Water, Sprite, . , and so on). Then allow the user to choose a beverage by entering a number 1-5. Output which beverage they chose. Sample Output: *Beverages* 1- COKE 50 2- WATER 20 3- SPRITE 60 4- ROYAL 50 5- MT.DEW 60 Choose a beverage : | Item name: ? Item price:? Amount: ? Amt. paid:_ (assume that the amt paid is equal or higher than amount) - Change:
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 7 steps with 4 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT