160k views
0 votes
Write a structured algorithm that prompts the user to input the name and price of an item and the quantity purchased. It should print the name, price, quantity and amount due.

1 Answer

4 votes

Answer:

The algorithm is as follows:

input name

input price

input quantity

amount = price * quantity

print name

print price

print quantity

print amount

Step-by-step explanation:

The next three lines get input for product name, price and quantity bought

input name

input price

input quantity

This calculates the amount

amount = price * quantity

The next four lines print the product name, price, quantity bought and the calculated amount

print name

print price

print quantity

print amount

User Sarema
by
4.5k points