Question: Starting Out with C++ From Control Structures through Objects, Tony Gaddis, 9th edition, ISBN 978- 0134498379 check all lines of the program must run in

Starting Out with C++ From Control Structures through Objects, Tony Gaddis, 9th edition, ISBN 978- 0134498379

check all lines of the program must run in visual studio 2019 thank you

Starting Out with C++ From Control Structures through Objects, Tony Gaddis, 9th

core 1436 P5 Functions Write a program that allows a customer to purchase multiple items. When the customer is finished with their selections, display the total and accept their payment. Functions: main(): Initialize total to 0 Use a loop to allow repeated selections: o Call addPurchase(). It should return the amount of the customer's choice or O if the customer is finished o Add the customer's purchase price to total o Repeat the loop unless addPurchase() returns 0 Call function printTotal(total) to display the total due Call function getPayment(total) to collect payment double addPurchase(): Use a loop and repeat until the customer makes a valid selection: o Display a list of at least 4 items for sale with prices o Get the customer's selection o Use a switch statement to get the amount of the customer's selection and return the amount or O if they want to quit o If the customer makes an invalid selection, show an error message and iterate through the loop again void printTotal(double total): Use neatly formatted output to show the customer's final total void getPayment(double total): Use a loop and repeat until the customer pays enough: Ask the customer for payment o Compute the change due o If they do not pay enough, display an error message and iterate through the loop again core 1436 P5 Functions Write a program that allows a customer to purchase multiple items. When the customer is finished with their selections, display the total and accept their payment. Functions: main(): Initialize total to 0 Use a loop to allow repeated selections: o Call addPurchase(). It should return the amount of the customer's choice or O if the customer is finished o Add the customer's purchase price to total o Repeat the loop unless addPurchase() returns 0 Call function printTotal(total) to display the total due Call function getPayment(total) to collect payment double addPurchase(): Use a loop and repeat until the customer makes a valid selection: o Display a list of at least 4 items for sale with prices o Get the customer's selection o Use a switch statement to get the amount of the customer's selection and return the amount or O if they want to quit o If the customer makes an invalid selection, show an error message and iterate through the loop again void printTotal(double total): Use neatly formatted output to show the customer's final total void getPayment(double total): Use a loop and repeat until the customer pays enough: Ask the customer for payment o Compute the change due o If they do not pay enough, display an error message and iterate through the loop again

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!