Scenario Your algorithm will keep track of a customers purch

Scenario

Your algorithm will keep track of a customer’s purchases at the local fireworks stand. Customers will not know exactly how many items they will purchase, so using a For loop on this lab is not allowed. Let’s keep the rules simple.

Accept the dollar value of each item purchased from the user until the user is finished.

When purchases are complete, enter a sentinel value of -1 (indicating that the user has finished).

If the item purchased is $50.00 or more, give your customer a 10% discount on the item purchased.

Display all of the purchases to the customer with the original price and the discount price.

BE SURE TO SEND IN THE C# code

Solution

Here is the algorithm:

When purchases are complete, enter a sentinel value of -1.

Keep track of the TOTAL dollar amount of all fireworks purchased.

Define real Discount =.10

DO //New customer loop

Print “Welcome to Brian’s Firework Stand”

define Real total = 0.0

define integer itemCount

Print \"Please enter the price of item (-1 to exit)\"

get itemPrice

while itemPrice is not -1

total = total + itemPrice

itemCount = itemCount + 1

Print \"Please enter the price of item (-1 to exit)\"

get itemPrice

End while

Print \"The total number of items purchased is \" itemCount

Print \"The average price of items is \" total / itemCount

if itemCount > 20

define totalDiscount = 0.0

Print \"The total price is \" total

totalDiscount = total * Discount

Print \"The The discount is \" totalDiscount

Print \"Amount due is \" total - totalDiscount

else

Print \"The total price is \" total

End-if

Print \"New customer? (Y/N)\"

get continue

while continue = \"Y\"

Scenario Your algorithm will keep track of a customer’s purchases at the local fireworks stand. Customers will not know exactly how many items they will purchas
Scenario Your algorithm will keep track of a customer’s purchases at the local fireworks stand. Customers will not know exactly how many items they will purchas

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site