The Jumpin Jive coffee shop charges $2 for a cup of coffee and offers add ins shown in the pseudocode. Using the following Pseudocode, Design
The Jumpin Jive coffee shop charges $2 for a cup of coffee and offers add ins shown in the pseudocode. Using the following Pseudocode, Design the logic for an application that allows a user to enter ordered add ins continuously until a sentinel value is entered. After each item, display its price or the message "Sorry, we do not carry that" as an output. After all items have been entered, display the total price for the order. Please write it in C++ language.
//Start
// Delcarations
// num SIZE = 5
// num COFFEEPRICE = 2.00
// string products[SIZE] = "whipped cream", Cinnamon", "Chocolate Sauce", "Amaretto", "Irish whiskey"
// num prices[Size] = .89, .25, .59, 1.5, 1.75
// num totalPrice = 0
// num choice = 0
// num SENTINEL = -1
// while (choice <> SENTINEL)
// output " Please select an item from the product menu by selecting the item number (1-5) or -1 to terminate: "
// output " Product Price ($)"
// output " ====== ====="
// output "1. Whipped cream 0.89"
// output "2. Cinnamon 0.25"
// output "3. Chocolate sauce 0.89"
// output "4. Amaretto 1.50"
// output "5. Irish whiskey 1.75"
// output "Please enter a positive number: "
// input choice // if (choice <> -1) then
// if ((choice >= 1) and (choice <= 5)) then
// totalPrice = totalPrice + prices[choice-1]
// output "Item number ", choice,": ", products[choice-1], " has been added"
// else // output "Item number ",choice, " is not valid", "Sorry we do not carry that item"
// endif
// endif
// endwhile
// totalPrice = totalPrice + COFFEEPRICE
// output "Total price of order is ",totalPrice
// output "Thanks for purchasing from Jumpin Jive Coffee Shop" // Stop
Step by Step Solution
There are 3 Steps involved in it
Step: 1
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started