Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q1: Using the template below, create a restaurant tip calculator. * The user will input the cost of the items on the bill. * Create

Q1: Using the template below, create a restaurant tip calculator.
* The user will input the cost of the items on the bill.
* Create a function that takes the item cost and returns the sales tax amount, Ohio has a 5.75% sales tax and Mahoning County collects an additional 1.50%, so the minimum sales tax rate in Mahoning County is 7.25%.
* Display the breakdown of each separate tax rate in the function as you make the calculation.
* Make sure you use the setprecision manipulator to output 2 decimal places in currency values, and explicitly output the leading dollar sign character '$' when showing any currency amount. You may find it helpful to also use the tab character '\t' and/or the setw manipulator to align columns.
* Output the subtotal of the items the user entered, the tax amount, and the subtotal.
* The user will choose a 10% (poor), 15% (average), or 20% (good) tip based on the quality of service from a menu that you will prompt the user for input. Based on their choice, write a conditional (if-elseif-else) that uses the chosen amount to calculate the appropriate value.
* Display the tip amount, and the total on the following line.
Q2: Add the option for the user to specify a tip percentage.
Q3: Prompt the user (a boolean y/n) whether to round the total up to the nearest whole number dollar amount, and adjust the tip value accordingly.
*/
#include
#include
using namespace std;
double calculateTax (double billAmt){
double ohioTax = 0.0575;
double countyTax = 0.015;
double totalTax = 0.0725;
double totalTaxAmt = 0.0;
// your code here
// break out the taxable amounts and output
// return the total tax applied to the bill
return totalTaxAmt;
}
int main(){
double billAmt = 0.0;
// SERVER:
cout << "SERVER - enter the food & beverage amount: ";
cin >> billAmt;
cout << "Food & beverage: $" << billAmt << endl;
// your code here
return 0;
}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 23rd European Conference Adbis 2019 Bled Slovenia September 8 11 2019 Proceedings Lncs 11695

Authors: Tatjana Welzer ,Johann Eder ,Vili Podgorelec ,Aida Kamisalic Latific

1st Edition

3030287297, 978-3030287290

More Books

Students also viewed these Databases questions