-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrestaurant.cpp
More file actions
25 lines (20 loc) · 834 Bytes
/
restaurant.cpp
File metadata and controls
25 lines (20 loc) · 834 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* Jacob Privitt
Tax and Tip calculator with a $44.50 meal charge. The tax should be 6.75% of
meal cost, and the tip should be 15% of the total with tax. Display the cost for
all of the amounts and the total bill. */
#include <iostream>
using namespace std;
int main()
{
double mealCost = 44.50, //Meal Cost
taxRate = .0675, //Tax Rate
tipRate = .15, //Tip Rate
taxAmt = mealCost * taxRate, //Tax Amount
subtotal = mealCost + taxAmt, //Subtotal
tipAmt = subtotal * tipRate, //Tip Amount
totalCost = subtotal + tipAmt; //Total Cost
cout << "Meal Cost: $" << mealCost << endl;
cout << "Tax Amount: $" << taxAmt << endl;
cout << "Tip Amount: $" << tipAmt << endl;
cout << "Total Cost: $" << totalCost << endl;
}