#include<stdio.h>
#include<conio.h>
int main()
{
printf("\n");
printf("###############################################################\n");
printf("********************Welcome to our Luvcafe*********************\n");
printf(" Instagram : https ://www.instagram.com/ Luvcafe /\n");
printf(" FAcebook : https ://www.facebook.com/ Luvcafe.7 \n");
printf("###############################################################\n");
printf(" ________________________________\n");
printf("|_______MENU Mink Luvcafe________|\n");
printf("| Menu Hot(1) Iced(2) |\n\n");
printf("| 1.Mocca 45 50 |\n\n");
printf("| 2.Latte 45 50 |\n\n");
printf("| 3.Cappuccino 55 60 |\n\n");
printf("| 4.Americano 55 60 |\n\n");
printf("| 5.Espresso 65 80 |\n\n");
printf("| 6.MAcchiato 60 80 |\n\n");
printf("| 7.Cocoa 50 60 |\n\n");
printf("| 8.Chocolate 50 60 |\n\n");
printf("| 9.Caramel 50 60 |\n");
printf("|________________________________|\n");
printf("| Exit with Program [191] |\n");
printf("|________________________________|\n");
char choose;
int menu=0,type=0,lvevl=0,num=0,sum=0,price=0;
printf("\nYou want coffee? [y/n] : ");
choose=getch();
printf("%c\n");
if(choose=='y'||choose=='Y'){
do
{
printf("Input Menu : ");
scanf("%d",menu);
if(menu<1||menu>9){
printf("Input Error!..Menu..1 2 3 4 5 6 7 8 9 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("Cocoa\n");
}else if(menu==8){
printf("Chocolate\n");
}else if(menu==9){
printf("Caramel\n");
}else if(menu==191){
printf("Finish order coffee.");
getch();
return 0;
}
} while(menu<1||menu>9);
do
{
printf("Input you type : ");
scanf("%d",&type);
if(type<1||type>2){
printf("Input Error!..type..1 or 2 only\n");
}else if(type==1){
printf("Hot Coffee\n");
}else if(type==2){
printf("Iced Coffee\n");
}
} while(type<1||type>2);
do
{
printf("Input you sweetness level : ");
scanf("%d",&"level");
if("level!=0&&level!=25&&level!=50&&level!=100"){
} printf("Input Error!..sweetness level = 0 or 25 or 50 or 100 nolv\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==50){
printf("50 Percent Less Sweet\n");
}else if(level==100){
printf("100 Percent Normal\n");
}
} "while"
level!=0&&level!=25&&level!=50&&level!=100);
'do'
{
printf("Input you want Numbr : ");
scanf("%d",&num);
if(num<=0){
printf("Input Error!..Numbr>0\n");
}
} while(num<=0);
printf("---------------OUTPUT---------------\n");
switch(menu)
{
case 1:
{ if(type==1){
printf("Mocca Hot coffee\n");
sum+=45;
} else if(type==2){
printf("Mocca Iced coffee\n");
sum+=50;
} price=num*sum;
printf("Coffee you prices is : %d Baht.\n",price);
break;
}
case 2:
{ if(type==1){
printf("Latte Hot Coffee\n");
sum+=45;
} else if(type==2){
printf("Latte Iced Coffee\n");
sum+=50;
} price=num*sum;
printf("Coffee you prices is : %d Baht.\n",price);
break;
}
case 3:
{ if(type==1){
printf("Cappuccino Hot Coffee\n");
sum+=55;
} else if(type==2){
printf("Cappuccino Iced Coffee\n");
sum+=60;
} price=num*sum;
printf("Coffee you prices is : %d Baht.\n",price);
break;
}
case 4:
{ if(type==1){
printf("Americano Hot Coffee\n");
sum+=55;
} else if(type==2){
printf("Latte Iced Coffee\n");
sum+=60;
} price=num*sum;
printf("Coffee you prices is : %d Baht.\n",price);
break;
}
case 5:
{ if(type==1){
printf("Espresso Hot Coffee\n");
sum+=65;
} else if(type==2){
printf("Espresso Iced Coffee\n");
sum+=80;
} price=num*sum;
printf("Coffee you prices is : %d Baht.\n",price);
break;
}
case 6:
{ if(type==1){
printf("Macchiato Hot Coffee\n");
sum+=65;
} else if(type==2){
printf("Espresso Iced Coffee\n");
sum+=80;
} price=num*sum;
printf("Coffee you prices is : %d Baht.\n",price);
break;
}
case 7:
{ if(type==1){
printf("Cocoa Hot coffee\n");
sum+=50;
} else if(type==2){
printf("Cocoa Iced coffee\n");
sum+=60;
} price=num*sum;
printf("Coffee you prices is : %d Baht.\n",price);
break;
}
case 8:
{ if(type==1){
printf("Chocolate Hot coffee\n");
sum+=50;
} else if(type==2){
printf("Chocolate Iced coffee\n");
sum+=60;
} price=num*sum;
printf("Coffee you prices is : %d Baht.\n",price);
break;
}
case 9:
{ if(type==1){
printf("Caramel Hot coffee\n");
sum+=50;
} else if(type==2){
printf("Caramel Iced coffee\n");
sum+=60;
} price=num*sum;
printf("Coffee you prices is : %d Baht.\n",price);
break;
}
}
}else{
printf("Thank you... Goodbye!\n");
}
printf("your Menu Number is : %5d.\n", menu);
printf("your type Number is : %5d.\n", type);
printf("your sweetness level: %5d Percent\n","level");
printf("And your have a list: %5d order.\n", num);
printf(" ");printf("Coffee your prices is: %5d Baht. \n",price);
getch(); return 0;
return 0;
}
ช่วยที ครับ ทำไมโค้ดร้านกาแฟไม่ถูก
#include<conio.h>
int main()
{
printf("\n");
printf("###############################################################\n");
printf("********************Welcome to our Luvcafe*********************\n");
printf(" Instagram : https ://www.instagram.com/ Luvcafe /\n");
printf(" FAcebook : https ://www.facebook.com/ Luvcafe.7 \n");
printf("###############################################################\n");
printf(" ________________________________\n");
printf("|_______MENU Mink Luvcafe________|\n");
printf("| Menu Hot(1) Iced(2) |\n\n");
printf("| 1.Mocca 45 50 |\n\n");
printf("| 2.Latte 45 50 |\n\n");
printf("| 3.Cappuccino 55 60 |\n\n");
printf("| 4.Americano 55 60 |\n\n");
printf("| 5.Espresso 65 80 |\n\n");
printf("| 6.MAcchiato 60 80 |\n\n");
printf("| 7.Cocoa 50 60 |\n\n");
printf("| 8.Chocolate 50 60 |\n\n");
printf("| 9.Caramel 50 60 |\n");
printf("|________________________________|\n");
printf("| Exit with Program [191] |\n");
printf("|________________________________|\n");
char choose;
int menu=0,type=0,lvevl=0,num=0,sum=0,price=0;
printf("\nYou want coffee? [y/n] : ");
choose=getch();
printf("%c\n");
if(choose=='y'||choose=='Y'){
do
{
printf("Input Menu : ");
scanf("%d",menu);
if(menu<1||menu>9){
printf("Input Error!..Menu..1 2 3 4 5 6 7 8 9 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("Cocoa\n");
}else if(menu==8){
printf("Chocolate\n");
}else if(menu==9){
printf("Caramel\n");
}else if(menu==191){
printf("Finish order coffee.");
getch();
return 0;
}
} while(menu<1||menu>9);
do
{
printf("Input you type : ");
scanf("%d",&type);
if(type<1||type>2){
printf("Input Error!..type..1 or 2 only\n");
}else if(type==1){
printf("Hot Coffee\n");
}else if(type==2){
printf("Iced Coffee\n");
}
} while(type<1||type>2);
do
{
printf("Input you sweetness level : ");
scanf("%d",&"level");
if("level!=0&&level!=25&&level!=50&&level!=100"){
} printf("Input Error!..sweetness level = 0 or 25 or 50 or 100 nolv\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==50){
printf("50 Percent Less Sweet\n");
}else if(level==100){
printf("100 Percent Normal\n");
}
} "while"level!=0&&level!=25&&level!=50&&level!=100);
'do'
{
printf("Input you want Numbr : ");
scanf("%d",&num);
if(num<=0){
printf("Input Error!..Numbr>0\n");
}
} while(num<=0);
printf("---------------OUTPUT---------------\n");
switch(menu)
{
case 1:
{ if(type==1){
printf("Mocca Hot coffee\n");
sum+=45;
} else if(type==2){
printf("Mocca Iced coffee\n");
sum+=50;
} price=num*sum;
printf("Coffee you prices is : %d Baht.\n",price);
break;
}
case 2:
{ if(type==1){
printf("Latte Hot Coffee\n");
sum+=45;
} else if(type==2){
printf("Latte Iced Coffee\n");
sum+=50;
} price=num*sum;
printf("Coffee you prices is : %d Baht.\n",price);
break;
}
case 3:
{ if(type==1){
printf("Cappuccino Hot Coffee\n");
sum+=55;
} else if(type==2){
printf("Cappuccino Iced Coffee\n");
sum+=60;
} price=num*sum;
printf("Coffee you prices is : %d Baht.\n",price);
break;
}
case 4:
{ if(type==1){
printf("Americano Hot Coffee\n");
sum+=55;
} else if(type==2){
printf("Latte Iced Coffee\n");
sum+=60;
} price=num*sum;
printf("Coffee you prices is : %d Baht.\n",price);
break;
}
case 5:
{ if(type==1){
printf("Espresso Hot Coffee\n");
sum+=65;
} else if(type==2){
printf("Espresso Iced Coffee\n");
sum+=80;
} price=num*sum;
printf("Coffee you prices is : %d Baht.\n",price);
break;
}
case 6:
{ if(type==1){
printf("Macchiato Hot Coffee\n");
sum+=65;
} else if(type==2){
printf("Espresso Iced Coffee\n");
sum+=80;
} price=num*sum;
printf("Coffee you prices is : %d Baht.\n",price);
break;
}
case 7:
{ if(type==1){
printf("Cocoa Hot coffee\n");
sum+=50;
} else if(type==2){
printf("Cocoa Iced coffee\n");
sum+=60;
} price=num*sum;
printf("Coffee you prices is : %d Baht.\n",price);
break;
}
case 8:
{ if(type==1){
printf("Chocolate Hot coffee\n");
sum+=50;
} else if(type==2){
printf("Chocolate Iced coffee\n");
sum+=60;
} price=num*sum;
printf("Coffee you prices is : %d Baht.\n",price);
break;
}
case 9:
{ if(type==1){
printf("Caramel Hot coffee\n");
sum+=50;
} else if(type==2){
printf("Caramel Iced coffee\n");
sum+=60;
} price=num*sum;
printf("Coffee you prices is : %d Baht.\n",price);
break;
}
}
}else{
printf("Thank you... Goodbye!\n");
}
printf("your Menu Number is : %5d.\n", menu);
printf("your type Number is : %5d.\n", type);
printf("your sweetness level: %5d Percent\n","level");
printf("And your have a list: %5d order.\n", num);
printf(" ");printf("Coffee your prices is: %5d Baht. \n",price);
getch(); return 0;
return 0;
}