Is my pseudocode correct? Imagine you are ordering from a fast food restaurant w
ID: 3865848 • Letter: I
Question
Is my pseudocode correct?
Imagine you are ordering from a fast food restaurant with 5 sandwich options, 5 snack options, and 5 drink options, shown below. Each item has a different price, and if you order a combo (1 of each item), you get a 25% discount off of each item in the combo. Write a pseudocode statement where you can input the items you want to order, and the statement calculates the total price of the order. Pseudocode Start Read Sandwiches Selection for A1 = $2.50, A2 - $3.50, A3 - $4.50, A4 - $5.00, A5 - $6.50 Read Snack Selection for B1 - $1.00, B2 - $1.50, B3 - $2.00, B4 - $2.50, B5 - $3.00 Read Drink Selection for C1 - $0.50, C2 - $0.75, C3 - $1.00, C4 - $1.25, C5 - $1.50 Input your Selection Option for Sandwiches, Snacks, Drinks Get Selections Calculate Selections Sum Print Selection Sum If Selections = 1 combo (1 of each selection) Calculate Combo 75 = Combo Price Print Combo Price StopExplanation / Answer
Instead of Combo*.75=Combo Price
Use
Combo Price=.75*Selection Sum
This is because, in the pseudocode, the variable Combo has not been assigned to anything and also, the discount is on the Selection sum only. So it's straightforward. Secondly, it is always a good practice to put the variable in which we are storing some data to be on the left side of the equals sign(=).
Other than that, the rest of the code is correct.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.