C++

Kurnia K.

asked • 05/25/23

Can you help me with this C++ program?

ABC Chat Time is a booth for you to order different kinds of beverages. To buy a beverage, the customer must first specify the quantity of beverages that he or she wants. Then, the customer can choose a beverage from the following 3 types:



No. Beverage Type Price (USD)
1 Espresso 1.50
2 Cappuccino 2.50
3 Latte 2.00



After that, the customer will have a choice to add extra milk with an additional price of 50 cents per beverage. Once the order has been made, the seller will show the total amount that the customer needs to pay.


Please note that if the quantity is more than one, then the customer needs to specify the beverage type for every beverage in the order. The customer needs to also specify whether to add extra milk or not for every beverage.


Write a C++ program to capture the above requirements. Refer to the next page for some sample outputs.


Some sample outputs for this program are as follows.

Sample 1



Please enter beverage quantity => 1


No. Type Price ($)
1. Espresso 1.50
2. Cappuccino 2.50
3. Latte 2.00


Please enter which beverage (1, 2 or 3) => 3

Please enter whether you want additional milk (Y or N) => Y The total amount is $2.50


Sample 2


Please enter beverage quantity => 2


No. Type Price ($)
1. Espresso 1.50
2. Cappuccino 2.50
3. Latte 2.00


Please enter which beverage (1, 2 or 3) => 1

Please enter whether you want additional milk (Y or N) => Y


No. Type Price ($)
1. Espresso 1.50
2. Cappuccino 2.50
3. Latte 2.00


Please enter which beverage (1, 2 or 3) => 2

Please enter whether you want additional milk (Y or N) => N The total amount is $4.50

1 Expert Answer

By:

Jose R. answered • 07/16/24

Tutor
New to Wyzant

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.