Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Christina Bolda
- CIS 125 - 71
- Final Exam
- Restaurant Register
- */
- #include "pch.h"
- #include <iostream>
- #include <cctype>
- #include <cstdlib>
- #include <iomanip>
- using namespace std;
- int main()
- {
- //Declaration Block
- char choice = 'Y';
- int order = 1;
- int num1 = 0;
- int num2 = 0;
- int num3 = 0;
- int num4 = 0;
- int num5 = 0;
- int num6 = 0;
- int numCustomers;
- int sentinel = 0;
- const double UnitPrice1 = 10.00, UnitPrice2 = 8.75, UnitPrice3 = 9.50, UnitPrice4 = 10.25, UnitPrice5 = 9.50, UnitPrice6 = 11.25;
- double AmountofSale1 = 0, AmountofSale2 = 0, AmountofSale3 = 0, AmountofSale4 = 0, AmountofSale5 = 0, AmountofSale6 = 0;
- cout << " Restauraunt Register \n"
- << "Dish No. Dish Name Price\n"
- << "-------- --------- -------\n"
- << "1 Gang Gai $10.00\n"
- << "2 Pad Thai $8.75\n"
- << "3 Pad Cashew $9.50\n"
- << "4 Pad Prik $10.25\n"
- << "5 Peanut Curry $9.50\n"
- << "6 Curry Noodle $11.25\n";
- while (order != sentinel)
- {
- cout << "Enter the item number you want (1-6): ";
- cin >> order;
- switch (order)
- {
- case 0:
- break;
- case 1:
- cout << "How many: ";
- cin >> num1;
- AmountofSale1 = UnitPrice1 * num1;
- break;
- case 2:
- cout << "How many: ";
- cin >> num2;
- AmountofSale2 = UnitPrice2 * num2;
- break;
- case 3:
- cout << "How many: ";
- cin >> num3;
- AmountofSale3 = UnitPrice3 * num3;
- break;
- case 4:
- cout << "How many: ";
- cin >> num4;
- AmountofSale4 = UnitPrice4 * num4;
- break;
- case 5:
- cout << "How many: ";
- cin >> num5;
- AmountofSale5 = UnitPrice5 * num5;
- break;
- case 6:
- cout << "How many: ";
- cin >> num6;
- AmountofSale6 = UnitPrice6 * num6;
- break;
- default: cout << "Please choose a valid item from our list\n";
- }
- char response;
- cout << "Is the person over 65? (Y/N) ";
- cin >> response;
- if (response == 'y')
- {
- cout << order * 0.90;
- }
- else
- {
- cout << order;
- }
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement