'Draw/Write the flowchart/pseudocode
A food stall sells the following: tempura, squid balls, hotdog, siomai and softdrink (soda). The cost of a tempura per stick is 10.00, squid balls per stick is 15.00, hotdog on a stick is 25.00, siomai per piece is 3.00 and a glass of a softdrink is 15.00. Suppose a certain customer buys all these, draw a flowchart/write a pseudocode to represent the logic of a program that allows the user to input the number of sticks of tempura, number of sticks of squid balls, number of sticks of hotdog, quantity of siomai, and number of glasses of a softdrink the customer bought. It should compute the payable per item (tempura, squid balls, hotdog, siomai and softdrink) and the total amount payable of the customer. The program should display the amount payable per item and the total payable of all items that the customer needs to pay.
Solution 1:[1]
print("Tempura?")
tempura <-- 10
tempura <-- tempura * int(USERINPUT)
print("Squid balls?")
squid <-- 15
squid <-- squid * int(USERINPUT)
print("Hot-dogs?")
hotdog <-- 25
hotdog <-- hotdog * int(USERINPUT)
print("Siomai?")
siomai <-- 3
siomai <-- siomai * int(USERINPUT)
print("Soda?")
soda <-- 15
soda <-- soda * int(USERINPUT)
print("Tempura: ", tempura)
print("Squid Balls: ", squid)
print("Hot-dogs: ", hotdog)
print("Siomai: ", siomai)
print("Soda: ", soda)
total <-- tempura + squid + hotdog + siomai + soda
print("Total: ", total)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | taylor.2317 |
