You are given a task to write a computer program for a Coffee Shop. Following is the table containing the list of product that you sell. Please be informed that all sales must include Sales Tax of 5%. For example if the customer orders one coffee with ice and creamer the total price is
Total Price = (1 * $1.50 + $0.30 + $0.50) * 1.05 = $2.42.
Your program must get the order from the customer and calculate the Total Price of his/her order. Customer can order multiple products at one time and your program must calculate the Total Price for all his/her order.
Product Base Price Add Ice Add Creamer Ice Blended(ice is
included)
coffee $1.50 +$0.30 +$0.50 +$1.20
tea $1.20 +$0.20 +$0.30 +$1.00
For all sales, there is a sales tax of 5%
1. Draw Flowchart diagram
2. Write a console program using C++ programming language.
meja
0
Newbie Poster
Recommended Answers
Jump to PostWell what do you need help with? Please post the code you attempted and highlight any sections and explain the problems.
Jump to PostThe hint here is that you need to draw a flow chart. Rather than thinking of a straight line, you will need to break off and create two parallel flows.
Imagine you're standing in line at the coffee shop, the first thing the cashier asks is "What would you like?" …
Jump to Postin line 20 change
total_cost= coffeePrice;
tototal_cost += coffeePrice;
This will keep adding additional items tototal_cost
until the program exits. If you plan on creating another order before the program exits just settotal_cost
to zero when you start the new order.A couple of notes:
if (order='C')
…
Jump to PostCan you please specify what the error is?
Jump to PostYou're missing several
break
statements which cause the code to 'fall through' from one case to the next.
break
essentially tells it to stop executing instructions in the current switch statement and continue execution at the next instruction after last brace}
of the switch statement.Example:
…
All 22 Replies
gerard4143
371
Nearly a Posting Maven
meja
0
Newbie Poster
Ketsuekiame
860
Master Poster
Featured Poster
ddanbe
commented:
Very good advice
+15
meja
0
Newbie Poster
meja
0
Newbie Poster
meja
0
Newbie Poster
tinstaafl
1,176
Posting Maven
meja
0
Newbie Poster
kal_crazy
13
Junior Poster
meja
0
Newbie Poster
Ketsuekiame
860
Master Poster
Featured Poster
meja
0
Newbie Poster
Ketsuekiame
860
Master Poster
Featured Poster
meja
0
Newbie Poster
Ketsuekiame
860
Master Poster
Featured Poster
meja
0
Newbie Poster
Ketsuekiame
860
Master Poster
Featured Poster
meja
0
Newbie Poster
Ketsuekiame
860
Master Poster
Featured Poster
meja
0
Newbie Poster
meja
0
Newbie Poster
Ketsuekiame
860
Master Poster
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.