Advertisement
Guest User

Untitled

a guest
Dec 13th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.25 KB | None | 0 0
  1. /*
  2. Christina Bolda
  3.  
  4. CIS 125 - 71
  5.  
  6. Final Exam
  7. Restaurant Register
  8. */
  9. #include "pch.h"
  10. #include <iostream>
  11. #include <cctype>
  12. #include <cstdlib>
  13. #include <iomanip>
  14.  
  15.  
  16. using namespace std;
  17.  
  18.  
  19. int main()
  20. {
  21.  
  22.  
  23. //Declaration Block
  24. char choice = 'Y';
  25. int order = 1;
  26. int num1 = 0;
  27. int num2 = 0;
  28. int num3 = 0;
  29. int num4 = 0;
  30. int num5 = 0;
  31. int num6 = 0;
  32. int numCustomers;
  33. int sentinel = 0;
  34. const double UnitPrice1 = 10.00, UnitPrice2 = 8.75, UnitPrice3 = 9.50, UnitPrice4 = 10.25, UnitPrice5 = 9.50, UnitPrice6 = 11.25;
  35. double AmountofSale1 = 0, AmountofSale2 = 0, AmountofSale3 = 0, AmountofSale4 = 0, AmountofSale5 = 0, AmountofSale6 = 0;
  36.  
  37.  
  38. cout << " Restauraunt Register \n"
  39. << "Dish No. Dish Name Price\n"
  40. << "-------- --------- -------\n"
  41. << "1 Gang Gai $10.00\n"
  42. << "2 Pad Thai $8.75\n"
  43. << "3 Pad Cashew $9.50\n"
  44. << "4 Pad Prik $10.25\n"
  45. << "5 Peanut Curry $9.50\n"
  46. << "6 Curry Noodle $11.25\n";
  47.  
  48. while (order != sentinel)
  49. {
  50. cout << "Enter the item number you want (1-6): ";
  51. cin >> order;
  52. switch (order)
  53. {
  54.  
  55. case 0:
  56. break;
  57.  
  58. case 1:
  59.  
  60. cout << "How many: ";
  61. cin >> num1;
  62.  
  63. AmountofSale1 = UnitPrice1 * num1;
  64. break;
  65.  
  66.  
  67.  
  68.  
  69. case 2:
  70. cout << "How many: ";
  71. cin >> num2;
  72.  
  73. AmountofSale2 = UnitPrice2 * num2;
  74. break;
  75.  
  76.  
  77. case 3:
  78. cout << "How many: ";
  79. cin >> num3;
  80.  
  81. AmountofSale3 = UnitPrice3 * num3;
  82. break;
  83.  
  84.  
  85.  
  86. case 4:
  87. cout << "How many: ";
  88. cin >> num4;
  89.  
  90. AmountofSale4 = UnitPrice4 * num4;
  91. break;
  92.  
  93.  
  94.  
  95. case 5:
  96. cout << "How many: ";
  97. cin >> num5;
  98.  
  99. AmountofSale5 = UnitPrice5 * num5;
  100. break;
  101.  
  102. case 6:
  103. cout << "How many: ";
  104. cin >> num6;
  105.  
  106. AmountofSale6 = UnitPrice6 * num6;
  107. break;
  108.  
  109. default: cout << "Please choose a valid item from our list\n";
  110. }
  111.  
  112. char response;
  113. cout << "Is the person over 65? (Y/N) ";
  114. cin >> response;
  115. if (response == 'y')
  116. {
  117. cout << order * 0.90;
  118. }
  119. else
  120. {
  121. cout << order;
  122. }
  123. }
  124. system("pause");
  125.  
  126. return 0;
  127. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement