Advertisement
Guest User

Untitled

a guest
Aug 14th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.86 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int main(void) {
  4.  
  5.     int num;
  6.     int OrderNumber = 0;
  7.     int yn;
  8.  
  9.     int TotalPrice = 0;
  10.  
  11.     char* food[5][2] = { {"Spaghetti", 18000}, {"Takoyaki", 15000}, {"Teriyaki", 25000}, {"Ramen", 20000}, {"Soba", 25000} };
  12.     int order[5][10];
  13.  
  14.     printf("Restaurant Menu Ver 1.0 \n");
  15.     printf("Press 1 for Menu Option \n");
  16.     printf("Press 2 for Pay Option \n");
  17.  
  18.     scanf_s("%d", &num);
  19.  
  20.     if (num == 1) {
  21.  
  22.         num = 0;
  23.         system("cls");
  24.         system("Color f");
  25.         printf("Our Menu \n");
  26.         printf("0 | %-9s       | RP %i,- \n", food[0][0], food[0][1]);
  27.         printf("1 | %-9s       | RP %i,- \n", food[1][0], food[1][1]);
  28.         printf("2 | %-9s       | RP %i,- \n", food[2][0], food[2][1]);
  29.         printf("3 | %-9s       | RP %i,- \n", food[3][0], food[3][1]);
  30.         printf("4 | %-9s       | RP %i,- \n", food[4][0], food[4][1]);
  31.  
  32.         printf("What would you like to order? (Insert The Number) \n");
  33.         scanf_s("%d", &num);
  34.  
  35.         printf("You chose %s \n", food[num][0]);
  36.  
  37.         TotalPrice = TotalPrice + food[num][1];
  38.  
  39.         printf("Price: %i \n", TotalPrice);
  40.         printf("Would you like to order more? (0/1) \n");
  41.         scanf_s("%i", &yn);
  42.  
  43.         if (yn == 1) {
  44.             system("cls");
  45.             system("Color f");
  46.             printf("Our Menu \n");
  47.             printf("0 | %-9s       | RP %i,- \n", food[0][0], food[0][1]);
  48.             printf("1 | %-9s       | RP %i,- \n", food[1][0], food[1][1]);
  49.             printf("2 | %-9s       | RP %i,- \n", food[2][0], food[2][1]);
  50.             printf("3 | %-9s       | RP %i,- \n", food[3][0], food[3][1]);
  51.             printf("4 | %-9s       | RP %i,- \n", food[4][0], food[4][1]);
  52.  
  53.             printf("What would you like to order? (Insert The Number) \n");
  54.             scanf_s("%d", &num);
  55.             printf("You chose %s \n", food[num][0]);
  56.  
  57.             TotalPrice = TotalPrice + food[num][1];
  58.  
  59.             printf("Price: %i \n", TotalPrice);
  60.         }
  61.     }
  62.  
  63.     else if (num == 2) {
  64.         printf("Payment \n");
  65.         printf("Your order was");
  66.     }
  67.  
  68.     system("pause > nul");
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement