fork download
  1. #include <iostream.h>
  2. #include <conio.h>
  3. #include <iomanip.h>
  4. #include <stdlib.h>
  5. #include <string.h>
  6. #include <stdio.h>
  7.  
  8.  
  9.  
  10. int main(){
  11. clrscr();
  12. const int cb=20,fl=20,yb=20,drinks=20,coke=20,
  13. sprite=20,royal=20,pj=25,med=5,large=10;
  14. int total,cash,change,quantity;
  15. int order = 1;
  16. const char *items[]={"Cheese Buger","Foot Long","Yum Burger","Drinks","Coke"
  17. ,"Sprite","Royal","Pineapple Juice"};
  18. char loop;
  19. int rows;
  20. int itemElements = sizeof(items)/sizeof(items[0]);
  21.  
  22. cout << "\t"<<setw(10) << "Item" << "\t" << " Price" <<"\t"<< "\n";
  23. cout << "\t" << "Cheese Burger" << "\t" << setw(5)<<cb << "\n";
  24. cout << "\t" << "Foot Long" << "\t" <<setw(5)<< fl << "\n";
  25. cout << "\t" << "Yum Burger" << "\t" <<setw(5)<< yb << "\n";
  26. cout << "\t" << "Water" << "\t" <<setw(14)<< drinks << "\n";
  27. cout << "\t" << "Coke" << "\t" <<setw(14) <<coke << "\n";
  28. cout << "\t" << "Sprite" << "\t" <<setw(14) <<sprite << "\n";
  29. cout << "\t" << "Royal" << "\t" <<setw(14) <<royal << "\n";
  30. cout << "\t" << "P.J" << "\t"<<setw(14)<< pj << "\n";
  31. cout << "\t" << "Med" << "\t" <<setw(14)<< med << "\n";
  32. cout << "\t" << "Large" << "\t" <<setw(14) <<large << "\n";
  33. cout << "Hi, Sir/Maam welcome to boboys! What would you like?" << "\n" ;
  34. struct food{
  35. char itemName;
  36. int price;
  37. };
  38. food f;
  39. do{
  40. cin >> order;
  41. switch(order)
  42. {
  43. case 0:
  44. break;
  45. case 1:
  46. cout << "How many Chesse Burgers do you Like?\n";
  47. cin >> quantity;
  48. total=cb * quantity;
  49. break;
  50.  
  51. case 2:
  52. cout << "How many Foot longs do you like?\n";
  53. cin >> quantity;
  54. total = fl * quantity;
  55. break;
  56.  
  57. case 3:
  58. cout << "How many Yum Burgers do you like?\n";
  59. cin >> quantity;
  60. total = yb * quantity;
  61. break;
  62.  
  63. case 4:
  64. cout << "How many Waters do you like?\n";
  65. cin >> quantity;
  66. total = drinks * quantity;
  67. break;
  68.  
  69. case 5:
  70. cout << "How many Cokes do you like?\n";
  71. cin >> quantity;
  72. total = coke * quantity;
  73. break;
  74.  
  75. case 6:
  76. cout << "How many Royals do you like?\n";
  77. cin >> quantity;
  78. total = royal * quantity;
  79. break;
  80.  
  81. case 7:
  82. cout << "How many Sprites do you like?\n";
  83. cin >> quantity;
  84. total = sprite * quantity;
  85. break;
  86.  
  87. case 8:
  88. cout << "How many Pine Apple Juices do you like?\n";
  89. cin >> quantity;
  90. total = pj * quantity;
  91. break;
  92.  
  93.  
  94.  
  95. default: cout << "Please select a Valid Order!";
  96. }
  97. cout << "Cash on Hand: ";
  98. cin >> cash;
  99.  
  100. change = total - cash;
  101. cout << "You Have Ordered \n";
  102. cout << "======================================================\n";
  103. cout << setw(15) << "ITEM" <<setw(15)<< "QUANTITY"<<setw(15)<< "PRICE\n";
  104. cout << "=====================================================\n";
  105. cout <<items[order-1]<<setw(15)<<quantity<<setw(15)<<total;
  106. cout << "\n";
  107. cout << "Would you like to Order Again? Y/N " ;
  108. cin >> loop;
  109.  
  110. } while(loop == 'Y'|| loop == 'y');
  111. cout << "Thank You, Your total Bill is: " << total;
  112. getche();
  113. return 0;
  114. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:22: fatal error: iostream.h: No such file or directory
 #include <iostream.h>
                      ^
compilation terminated.
stdout
Standard output is empty