fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5. return 0;
  6. }
  7.  
Success #stdin #stdout 0s 5296KB
stdin
#include <stdio.h>
void main()
{

    printf("\n");
    printf("******************** Welcome to COFFEE PRINCE ********************");
    printf("\n");
     printf(" ________________________________________\n");
     printf("|___________MENU COFFEE PRINCE___________|\n");
     printf("|      Menu      Hot(1) Iced(2) Frappe(3)|\n\n");
     printf("| 1.Mocca          45     50      60     |\n\n");
     printf("| 2.Latte          45     50      60     |\n\n");
     printf("| 3.Cappuccino     55     60      70     |\n\n");
     printf("| 4.Americano      35     55      --     |\n\n");
     printf("| 5.Espresso       35     50      60     |\n\n");
     printf("| 6.Macchiato      50     60      70     |\n\n");
     printf("| 7.Chocolate      40     50      60     |\n\n");
     printf("| 8.Fresh Milk     35     40      50     |\n\n");
     printf("| 9.Tea with milk  35     40      50     |\n\n");
     printf("| 10.Green Tea     35     40      50     |\n");
     printf("|________________________________________|\n");

     int menu=0,type=0,level=0,num=0,sum=0,price=0;

     printf("\n");
     printf("***** Please input number only *****\n");
     do
     {
     printf("Input your order : ");
     scanf("%d",&menu);
     if(menu<1||menu>10){
        printf("Please choose...Menu... 1 2 3 4 5 6 7 8 9 10 only\n");
     }else if(menu==1){
        printf("Mocca..\n");

     }else if(menu==2){
        printf("Latte..\n");

     }else if(menu==3){
        printf("Cappuccino..\n");

     }else if(menu==4){
        printf("Americano..\n");

     }else if(menu==5){
        printf("Espresso..\n");

     }else if(menu==6){
        printf("Macchiato..\n");

     }else if(menu==7){
        printf("Chocolate..\n");

     }else if(menu==8){
        printf("Fresh Milk..\n");

     }else if(menu==9){
        printf("Tea with milk..\n");

     }else if(menu==10){
        printf("Green Tea..\n");
     }
}    while(menu<1||menu>10);
     do
     {
        printf("Input your type : ");
        scanf("%d",&type);
        if(type<1||type>3){
        printf("Please choose..type..1 or 2 or 3 only\n");
        }else if(type==1){
           printf("Hot..\n");
        }else if(type==2){
           printf("Iced..\n");
        }else if(type==3){
           if(menu==4){
            printf("Sorry! This menu don't have Frappe\n");
            printf("Please choose..type..1 or 2 only\n");
            printf("Input your type : ");
            scanf("%d",&type);
        }if(type==1){
           printf("Hot..\n");
        }else if(type==2){
           printf("Iced..\n");
        }else
            printf("Frappe..\n");
        }

}    while(type<1||type>3);
     do
     {
        printf("Input your sweetness level : ");
        scanf("%d",&level);
        if(level!=0&&level!=25&&level!=50&&level!=100){
           printf("Please choose..sweetness level = 0 or 25 or 50 or 100 only\n");
        }else if(level==0){
           printf("0 Percent..Not Sweet\n");
        }else if(level==25){
           printf("25 Percent..Less Less Sweet\n");
        }else if(level==25){
           printf("25 Percent..Less Less Sweet\n");
        }else if(level==50){
           printf("50 Percent..Less Sweet\n");
        }else if(level==100){
           printf("100 Percent..Normal Sweet\n");
        }
}    while(level!=0&&level!=25&&level!=50&&level!=100);
     do
     {
        printf("Number you want : ");
        scanf("%d",&num);
        if(num<=0){
           printf("Please choose again\n");
        }
}   while (num<=0);
    printf("\n");
    printf("__________YOUR ORDER__________\n");
    printf("\n");
    switch(menu)
    {
    case 1:
         {  if(type==1){
            printf("Hot Mocca..\n");
            sum+=45;
      }else if(type==2){
            printf("Iced Mocca..\n");
            sum+=50;
      }else if(type==3){
            printf("Frappe Mocca..\n");
            sum+=60;
      }     price=num*sum;
            printf("Total prices    : %d Baht.\n",price);
            break;
         }
    case 2:
         {  if(type==1){
            printf("Hot Latte..\n");
            sum+=45;
      }else if(type==2){
            printf("Iced Latte..\n");
            sum+=50;
      }else if(type==3){
            printf("Frappe Latte..\n");
            sum+=60;
      }     price=num*sum;
            printf("Total prices    : %d Baht.\n",price);
            break;
         }
     case 3:
         {  if(type==1){
            printf("Hot Cappuccino..\n");
            sum+=55;
      }else if(type==2){
            printf("Iced Cappuccino..\n");
            sum+=60;
      }else if(type==3){
            printf("Frappe Cappuccino..\n");
            sum+=70;
      }     price=num*sum;
            printf("Total prices    : %d Baht.\n",price);
            break;
         }
     case 4:
         {  if(type==1){
            printf("Hot Americano..\n");
            sum+=35;
      }else if(type==2){
            printf("Iced Americano..\n");
            sum+=55;
      }     price=num*sum;
            printf("Total prices    : %d Baht.\n",price);
            break;
         }
     case 5:
         {  if(type==1){
            printf("Hot Espresso..\n");
            sum+=35;
      }else if(type==2){
            printf("Iced Espresso..\n");
            sum+=50;
      }else if(type==3){
            printf("Frappe Espresso..\n");
            sum+=60;
      }     price=num*sum;
            printf("Total prices    : %d Baht.\n",price);
            break;
         }
     case 6:
         {  if(type==1){
            printf("Hot Macchiato..\n");
            sum+=50;
      }else if(type==2){
            printf("Iced Macchiato..\n");
            sum+=60;
      }else if(type==3){
            printf("Frappe Macchiato..\n");
            sum+=70;
      }     price=num*sum;
            printf("Total prices    : %d Baht.\n",price);
            break;
         }
     case 7:
         {  if(type==1){
            printf("Hot Chocolate..\n");
            sum+=40;
      }else if(type==2){
            printf("Iced Chocolate..\n");
            sum+=50;
      }else if(type==3){
            printf("Frappe Chocolate..\n");
            sum+=60;
      }     price=num*sum;
            printf("Total prices    : %d Baht.\n",price);
            break;
         }
     case 8:
         {  if(type==1){
            printf("Hot Fresh Milk..\n");
            sum+=35;
      }else if(type==2){
            printf("Iced Fresh Milk..\n");
            sum+=40;
      }else if(type==3){
            printf("Frappe Fresh Milk..\n");
            sum+=50;
      }     price=num*sum;
            printf("Total prices    : %d Baht.\n",price);
            break;
         }
     case 9:
         {  if(type==1){
            printf("Hot Tea with milk..\n");
            sum+=35;
      }else if(type==2){
            printf("Iced Tea with milk..\n");
            sum+=40;
      }else if(type==3){
            printf("Frappe Tea with milk..\n");
            sum+=50;
      }     price=num*sum;
            printf("Total prices   : %d Baht.\n",price);
            break;
         }
     case 10:
         {  if(type==1){
            printf("Hot Green Tea..\n");
            sum+=35;
      }else if(type==2){
            printf("Iced Green Tea..\n");
            sum+=40;
      }else if(type==3){
            printf("Frappe Green Tea..\n");
            sum+=50;
      }     price=num*sum;
            printf("Total prices   : %d Baht.\n",price);
            break;
         }
    }
    printf("Menu Number     : %4d.\n",menu);
    printf("Type Number     : %4d.\n",type);
    printf("Sweetness level : %4d.\n",level);
    printf("Number of cup   : %4d.\n",num);
    printf("\n");
    printf("Thank you...Have a nice day!\n");
    printf("_______________________________");
    return 0;
}
stdout
Standard output is empty