Advertisement
Guest User

Untitled

a guest
Feb 17th, 2020
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.79 KB | None | 0 0
  1. #include <stdio.h>
  2. char foodies[][50]={"NASI AYAM","NASI GORENG","NASI DAGANG"};
  3. char drinkies[][50]={"TEH O AIS","TEH AIS","MILO AIS"};
  4. int n=0;
  5. int menu;
  6.  
  7. void main()
  8. {
  9.     printf("\n\tWELCOME TO RESTAURANT SYSTEM");
  10.     printf("\n\t  PLEASE CHOOSE THE MENU\n");
  11.     selection();
  12. }
  13.  
  14. void selection()
  15. {
  16.     printf("\n1.FOOD");
  17.     printf("\n2.BAVERAGE");
  18.     printf("\n3.EXIT\n");
  19.     printf("\nPLEASE SELECT INPUT :");
  20.     scanf("%d",&menu);
  21.     switch(menu)
  22.     {
  23.         case 1 : printf("\nCHOOSE FOOD PLES"); break;
  24.         case 2 : printf("\nCHOOSE DRINK PLES"); break;
  25.         case 3 : printf("\nBYE BYE HAVE A NICE DAY"); break;
  26.         default: printf("\nINVALID OPTION"); break;
  27.     }
  28.     if(menu==1)
  29.     {
  30.         food1();
  31.         selection();
  32.     }
  33.     if(menu==2)
  34.     {
  35.         drink1();
  36.         selection();
  37.     }
  38.     if(menu==3)
  39.     {
  40.         while(n);
  41.     }
  42. }
  43. void food1()
  44. {
  45.     printf("\n1. %s",foodies[0]);
  46.     printf("\n2. %s",foodies[1]);
  47.     printf("\n3. %s\n",foodies[2]);
  48.     scanf("\n%d",&menu);
  49.     switch(menu)
  50.     {
  51.         case 1 : printf("\nYOUR FOOD IS %s",foodies[0]); break;
  52.         case 2 : printf("\nYOUR FOOD IS %s",foodies[1]); break;
  53.         case 3 : printf("\nYOUR FOOD IS %s\n",foodies[2]); break;
  54.         default: printf("\nINVALID OPTION"); break;
  55.     }
  56.     drink1();
  57. }
  58.  
  59. void drink1()
  60. {
  61.     printf("\n1. %s",drinkies[0]);
  62.     printf("\n2. %s",drinkies[1]);
  63.     printf("\n3. %s",drinkies[2]);
  64.     scanf("\n%d",&menu);
  65.     switch(menu)
  66.     {
  67.         case 1 : printf("\nYOUR DRINK IS %s",drinkies[0]); break;
  68.         case 2 : printf("\nYOUR DRINK IS %s",drinkies[1]); break;
  69.         case 3 : printf("\nYOUR DRINK IS %s",drinkies[2]); break;
  70.         default: printf("\nINVALID OPTION"); break;
  71.     }
  72.     food1();
  73.  
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement