Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program using functions that calculate the amount given to a customer based on their total The program premps the to either an item
Write a program using functions that calculate the amount given to a customer based on their total The program premps the to either an item choice, quantity, and payment amount. Use while loops for all error checking Range for inputs Quantity: (1-20]: (Quantity must be a whole number) Pay amount ($0.00-$100.00|Payment maybe a decimal) bool isvalidchoice (chair) - takes the user choice as an argument, and returns true it is a valid selection Otherwise it returns false. Float calculates the subtotal, and return the grand total with sales tax (5.25%). Float calchange (float, float) - Takes total and the amount paid and returns the change. Amount paid must be higher than the total
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
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