Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Program # 5 Write a program that follows these specifications: 1. The program should have a constant that stores the current Mississippi sales tax rate
Program # 5 Write a program that follows these specifications: 1. The program should have a constant that stores the current Mississippi sales tax rate as 2. The main function of the program should prompt the user for the subtotal and store this 3. The main function must call a value-returning function defined by you called a double. value in a variable. calculateSalesTax, passing the subtotal to the function by value. The calculateSalesTax function must return the sales tax based on the subtotal. You will need to store the sales tax in a variable inside your main function. 4. The main function must call a value-returning function defined by you called calculateTotal, passing the subtotal and sales tax to the function by value. The calculateTotal function must return the total based on the subtotal and sales tax. You will need to store the total in a variable inside your main function. The main function must call a void function defined by you called printReceipt that will print a simple receipt. You will need to pass the subtotal, sales tax, and total by value to this function. This function will print the subtotal, sales tax, and total. These values must be rounded to two-decimal places 5. Here's some sample output: Subtotal: $1.00 Sales Tax: $0.07 Total: $1.07
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