#include <stdlib.h>
int main()
{
printf("______________________________________________________________________________\n");
printf("|____________________________________MENU_____________________________________|\n");
printf("|1.Thai Fried noodles------------[A]-----|price--------------------------40 B.|\n\n");
printf("|2.Criispy Porck With Kale------------|price--------------------------30 B.|\n\n");
printf("|3.Soup--------------------------[C]-----|price--------------------------40 B.|\n\n");
printf("|4.Massa Man Curry---------------[D]-----|price--------------------------45 B.|\n\n");
printf("|5.Spicy Noodle Salad------------[E]-----|price--------------------------40 B.|\n\n");
printf("|6.Tom Yum kung------------------[F]-----|price--------------------------50 B.|\n");
printf("|_____________________________________________________________________________|\n");
printf("| Exit with program [p]| |\n");
printf("|_____________________________________________________________________________\n");
//variable
char choose,menu;
int count=0,sum=0;
//your choose
printf("\n\nYou want food?[y/n] : ") ;
choose=getch();
printf("%c\n");
//your choose 'y'
if(choose=='y'){
while(menu!='P'||menu!='p'){
count+=-1
printf("\n\nPlease insert your food : ");
menu=getch();
if(menu=='A'||menu=='a'){
printf("Thai Fried Noodles 40 B.");
sum+=40;
}else if (menu=='B'||menu=='b'){
printf("Criispy Porck With Kale 30 B.");
sum+=30;
}else if (menu=='C'||menu=='c'){
printf("soup 40 B.");
sum+40;
}else if (menu=='D'||menu=='d'){
printf("Massa Man Curry 45 B.");
sum+=45;
}else if (menu=='E'||menu=='e'){
printf("Spicy Noodle Salad 40 B.");
sum+=40;
}else if (menu=='F'||menu=='f'){
printf("Tom Yom Kung 50 B.");
sum+=50;
//exit progrom
}else if(menu=="P"||menu=="p"){
printf("Finish order food.");
printf("\n\nAnd you have a list %d items...",count-1);
printf("\n\nFood you prices is : %d B.",sum);
printf("\n\nFree water drink");
printf("\n\n....Please a wait....");
break;
}else{
printf("Try again!");
}
}
}else{
printf("\n\n\a\aThank You...Goodbye!");
}
getch();
return 0;
}
พอจะช่วยแก้ให้หน่อยได้ไหม คาบ แก้หลายครั้งแล้วมัน ลัน ไม่ได้สักที ไม่รู้ว่ามันผิดตรงไหน
int main()
{
printf("______________________________________________________________________________\n");
printf("|____________________________________MENU_____________________________________|\n");
printf("|1.Thai Fried noodles------------[A]-----|price--------------------------40 B.|\n\n");
printf("|2.Criispy Porck With Kale------------|price--------------------------30 B.|\n\n");
printf("|3.Soup--------------------------[C]-----|price--------------------------40 B.|\n\n");
printf("|4.Massa Man Curry---------------[D]-----|price--------------------------45 B.|\n\n");
printf("|5.Spicy Noodle Salad------------[E]-----|price--------------------------40 B.|\n\n");
printf("|6.Tom Yum kung------------------[F]-----|price--------------------------50 B.|\n");
printf("|_____________________________________________________________________________|\n");
printf("| Exit with program [p]| |\n");
printf("|_____________________________________________________________________________\n");
//variable
char choose,menu;
int count=0,sum=0;
//your choose
printf("\n\nYou want food?[y/n] : ") ;
choose=getch();
printf("%c\n");
//your choose 'y'
if(choose=='y'){
while(menu!='P'||menu!='p'){
count+=-1
printf("\n\nPlease insert your food : ");
menu=getch();
if(menu=='A'||menu=='a'){
printf("Thai Fried Noodles 40 B.");
sum+=40;
}else if (menu=='B'||menu=='b'){
printf("Criispy Porck With Kale 30 B.");
sum+=30;
}else if (menu=='C'||menu=='c'){
printf("soup 40 B.");
sum+40;
}else if (menu=='D'||menu=='d'){
printf("Massa Man Curry 45 B.");
sum+=45;
}else if (menu=='E'||menu=='e'){
printf("Spicy Noodle Salad 40 B.");
sum+=40;
}else if (menu=='F'||menu=='f'){
printf("Tom Yom Kung 50 B.");
sum+=50;
//exit progrom
}else if(menu=="P"||menu=="p"){
printf("Finish order food.");
printf("\n\nAnd you have a list %d items...",count-1);
printf("\n\nFood you prices is : %d B.",sum);
printf("\n\nFree water drink");
printf("\n\n....Please a wait....");
break;
}else{
printf("Try again!");
}
}
}else{
printf("\n\n\a\aThank You...Goodbye!");
}
getch();
return 0;
}