Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<iomanip>
- #include<Windows.h>
- #include<string>
- using namespace std;
- double taxrateCalculator(double subtotal, double taxRate);
- double tiprateCalculator(double costofmeal, double tipRate, int tipSelect);
- int main()
- {
- double walletcontents = 60, taxRate = 10 / 100, costofmeal, subtotal, bullets, remainder, mealTotal;
- int mealselect, storydecision1, storydecision2;
- string name, location;
- int tipSelect;
- cout << "Flavor Text...";
- cout << endl;
- cout << "Flavor Text...";
- cout << endl;
- system("pause");
- system("cls");
- cout << "Name Query?" << endl;
- cin >> name;
- cout << "Flavor Text..." << name << " Flavor Text....";
- cout << endl;
- system("pause");
- system("cls");
- cout << "Location Question?";
- cin >> location;
- cout << endl << "Flavor Text...";
- system("pause");
- system("cls");
- cout << " Menu Prototype ";
- cout << endl << endl;
- cout << "Option 1. $35.00" << endl;
- cout << "Option 2. $45.00" << endl;
- cin >> mealselect;
- if (mealselect = 1)
- {
- subtotal = 35;
- costofmeal = 35;
- cout << "Response";
- system("pause");
- system("cls");
- }
- else if (mealselect = 2)
- {
- subtotal = 45;
- costofmeal = 45;
- cout << "Response";
- system("pause");
- system("cls");
- }
- cout << "Tip menu!";
- cout << endl << "1. 20%";
- cout << endl << "2. 15%";
- cout << endl << "3. 10%";
- cout << endl << "4. 5%";
- cin >> tipSelect;
- system("pause");
- system("cls");
- double totalTax = taxrateCalculator(subtotal, taxRate);
- double totalTip = tiprateCalculator(costofmeal, tipRate, tipSelect);
- cout << "Story Response. Bullet Query." << endl;
- cout << "Your meal was $" << costofmeal << endl;
- cout << "Your total tax is $" << totalTax << " " << endl;
- cout << "";
- system("pause");
- }
- double taxrateCalculator(double subtotal, double taxRate)
- {
- taxRate = subtotal * 10 / 100;
- return taxRate;
- }
- double tiprateCalculator(double costofmeal, double tipRate, int tipSelect)
- {
- double tip;
- while (tipSelect = 1)
- {
- tip = costofmeal * (20 / 100);
- return tip;
- }
- while (tipSelect = 2)
- {
- tip = costofmeal * (15 / 100);
- return tip;
- }
- while (tipSelect = 3)
- {
- tip = costofmeal * (10 / 100);
- return tip;
- }
- while (tipSelect = 4)
- {
- tip = costofmeal * (5 / 100);
- return tip;
- }
- tipRate = tip * 1;
- return tipRate;
- }
Advertisement
Add Comment
Please, Sign In to add comment