Code:
#include<stdio.h>
#include<ctype.h>
#include<conio.h>
main()
{
int z,i,x;
int s=0,f=0,sal=0,b=0,d=0,bev=0;
int v_meal,f_size,cat,quantity;
float price,subtotal=0,cash,change,vat;
char pwd,ans,add_up;
char pass[10];
password:
clrscr();
i=0;
gotoxy(24,9);textcolor(YELLOW);cprintf("Welcome to McDonald's Corporation ");
gotoxy(20,10);textcolor(YELLOW);cprintf("Please Enter Password to continue transaction");
gotoxy(32,13);textcolor(YELLOW);cprintf("Enter Password ");
while((pwd=getch()) !='\r') {
printf("Ø");
pass[i]=pwd;
i++;
}
pass[i]='\0';
if(strcmp(pass,"denise"))
goto password;
else{
clrscr();
gotoxy(29,14);textcolor(YELLOW);cprintf("*");
gotoxy(29,13);textcolor(YELLOW);cprintf("*");
gotoxy(30,12);textcolor(YELLOW);cprintf("*");
gotoxy(31,11);textcolor(YELLOW);cprintf("*");
gotoxy(32,10);textcolor(YELLOW);cprintf("*");
gotoxy(33,9);textcolor(YELLOW);cprintf("*");
gotoxy(34,9);textcolor(YELLOW);cprintf("*");
gotoxy(35,10);textcolor(YELLOW);cprintf("*");
gotoxy(36,11);textcolor(YELLOW);cprintf("*");
gotoxy(37,12);textcolor(YELLOW);cprintf("*");
gotoxy(37,13);textcolor(YELLOW);cprintf("*");
gotoxy(38,14);textcolor(YELLOW);cprintf("*");
gotoxy(39,13);textcolor(YELLOW);cprintf("*");
gotoxy(39,12);textcolor(YELLOW);cprintf("*");
gotoxy(40,11);textcolor(YELLOW);cprintf("*");
gotoxy(41,10);textcolor(YELLOW);cprintf("*");
gotoxy(42,9);textcolor(YELLOW);cprintf("*");
gotoxy(43,9);textcolor(YELLOW);cprintf("*");
gotoxy(44,10);textcolor(YELLOW);cprintf("*");
gotoxy(45,11);textcolor(YELLOW);cprintf("*");
gotoxy(46,12);textcolor(YELLOW);cprintf("*");
gotoxy(47,13);textcolor(YELLOW);cprintf("*");
gotoxy(47,14);textcolor(YELLOW);cprintf("*");
gotoxy(32,16);textcolor(YELLOW+BLINK);cprintf("pa para papap");
gotoxy(33,16);textcolor(YELLOW);cprintf("\nLove ko 'to");
getch();
}
clrscr();
category:
gotoxy(15,3);textcolor(YELLOW);cprintf("************ SELECT A MENU CATEGORY ************ ");
gotoxy(10,7);textcolor(YELLOW);cprintf("[1] Sandwiches");
gotoxy(10,8);textcolor(YELLOW);cprintf("[2] French Fries");
gotoxy(10,9);textcolor(YELLOW);cprintf("[3] Salads");
gotoxy(10,10);textcolor(YELLOW);cprintf("[4] Breakfast");
gotoxy(10,11);textcolor(YELLOW);cprintf("[5] Desserts");
gotoxy(10,12);textcolor(YELLOW);cprintf("[6] Beverage");
gotoxy(10,13);textcolor(YELLOW);cprintf("[7] Combo Meals");
gotoxy(27,17);textcolor(YELLOW);cprintf("Meal Category #: ");
gotoxy(45,17);textcolor(YELLOW);cscanf("%d", &cat);
if(cat>7 || cat<=0)
{
goto category;
}
else if(cat==1)
{
clrscr();
getch();
sand:
gotoxy(24,3);textcolor(YELLOW);cprintf("*********** SANDWICHES ************ ");
gotoxy(10,7);textcolor(YELLOW);cprintf("[1] Hamburger 1.00");
gotoxy(10,8);textcolor(YELLOW);cprintf("[2] Chessburger 1.00");
gotoxy(10,9);textcolor(YELLOW);cprintf("[3] Double Chessburger 1.00");
gotoxy(10,10);textcolor(YELLOW);cprintf("[4] Big Mac 1.00");
gotoxy(10,11);textcolor(YELLOW);cprintf("[5] Filet-O-Fish 1.00");
gotoxy(27,17);textcolor(YELLOW);cprintf("Meal number: ");
gotoxy(43,17);textcolor(YELLOW);cscanf("%d", &s);
switch(s)
{
case 1:price=1.00;break;
case 2:price=2.00;break;
case 3:price=3.00;break;
case 4:price=4.00;break;
case 5:price=5.00;break;
}
if(s>5 || s<=0)
{
goto sand;
}
else
{
goto quant;
}
}
else if(cat==2)
{
clrscr();
getch();
fries:
gotoxy(24,3);textcolor(YELLOW);cprintf("************ FRENCH FRIES ************ ");
gotoxy(10,7);textcolor(YELLOW);cprintf("[1] Small French Fries 1.00");
gotoxy(10,8);textcolor(YELLOW);cprintf("[2] Medium French Fries 1.00");
gotoxy(10,9);textcolor(YELLOW);cprintf("[3] Large French Fries 1.00");
gotoxy(27,17);textcolor(YELLOW);cprintf("Meal Number: ");
gotoxy(43,17);textcolor(YELLOW);cscanf("%d", &f);
switch(f)
{
case 1:price=1.00;break;
case 2:price=2.00;break;
case 3:price=3.00;break;
}
if(f>3 || f<=0)
{
goto fries;
}
else
{
goto quant;
}
}
else if(cat==3)
{
clrscr();
getch();
salad:
gotoxy(26,3);textcolor(YELLOW);cprintf("************ SALADS *********** ");
gotoxy(10,7);textcolor(YELLOW);cprintf("[1] Veggie Salad 1.00");
gotoxy(10,8);textcolor(YELLOW);cprintf("[2] Salad with Grilled Chicken 1.00");
gotoxy(10,9);textcolor(YELLOW);cprintf("[3] Salad with Crispy Chicken 1.00");
gotoxy(27,17);textcolor(YELLOW);cprintf("Meal Number:");
gotoxy(43,17);textcolor(YELLOW);cscanf("%d",&sal);
switch(sal)
{
case 1:price=1.00;break;
case 2:price=2.00;break;
case 3:price=3.00;break;
}
if(sal>3 || sal<=0)
{
goto salad;
}
else
{
goto quant;
}
}
else if(cat==4)
{
clrscr();
getch();
breakfast:
gotoxy(24,3);textcolor(YELLOW);cprintf("************ BREAKFAST ************");
gotoxy(10,7);textcolor(YELLOW);cprintf("[1] Egg Mcmuffin 1.00");
gotoxy(10,8);textcolor(YELLOW);cprintf("[2] Sausage Mcmuffin 1.00");
gotoxy(10,9);textcolor(YELLOW);cprintf("[3] Bacon, Egg & Cheese 1.00");
gotoxy(10,10);textcolor(YELLOW);cprintf("[4] Hotcakes 1.00");
gotoxy(27,17);textcolor(YELLOW);cprintf("Meal Number:");
gotoxy(43,17);textcolor(YELLOW);cscanf("%d", &b);
switch(b)
{
case 1:price=1.00;break;
case 2:price=2.00;break;
case 3:price=3.00;break;
case 4:price=4.00;break;
}
if(b>4 || b<=0)
{
goto breakfast;
}
else
{
goto quant;
}
}
else if(cat==5)
{
clrscr();
getch();
dessert:
gotoxy(24,3);textcolor(YELLOW);cprintf("************ DESSERTS ************");
gotoxy(10,7);textcolor(YELLOW);cprintf("[1] Strawberry Sundae 1.00");
gotoxy(10,8);textcolor(YELLOW);cprintf("[2] Hot Caramel Sundae 1.00 ");
gotoxy(10,9);textcolor(YELLOW);cprintf("[3] Hot Fudge Sundae 1.00");
gotoxy(10,10);textcolor(YELLOW);cprintf("[4] Vanilla IceCream 1.00");
gotoxy(10,11);textcolor(YELLOW);cprintf("[5] Coke Float 1.00");
gotoxy(27,17);textcolor(YELLOW);cprintf("Meal Number:");
gotoxy(43,17);textcolor(YELLOW);cscanf("%d", &d);
switch(d)
{
case 1:price=1.00;break;
case 2:price=2.00;break;
case 3:price=3.00;break;
case 4:price=4.00;break;
case 5:price=5.00;break;
}
if(d>5 || d<=0)
{
goto dessert;
}
else
{
goto quant;
}
}
else if(cat==6)
{
clrscr();
getch();
beverage:
gotoxy(24,3);textcolor(YELLOW);cprintf("************ BEVERAGES ************");
gotoxy(10,7);textcolor(YELLOW);cprintf("[1] Orange Juice(small) 1.00");
gotoxy(10,8);textcolor(YELLOW);cprintf("[2] Orange Juice(medium) 1.00");
gotoxy(10,9);textcolor(YELLOW);cprintf("[3] Orange Juice(large) 1.00");
gotoxy(10,10);textcolor(YELLOW);cprintf("[4] Coca-Cola (small) 1.00");
gotoxy(10,11);textcolor(YELLOW);cprintf("[5] Coca-Cola (medium) 1.00");
gotoxy(10,12);textcolor(YELLOW);cprintf("[6] Coca-Cola (large) 1.00");
gotoxy(10,13);textcolor(YELLOW);cprintf("[7] Ice tea(small) 1.00");
gotoxy(10,14);textcolor(YELLOW);cprintf("[8] Ice tea(medium) 1.00");
gotoxy(10,15);textcolor(YELLOW);cprintf("[9] Ice tea(large) 1.00");
gotoxy(27,17);textcolor(YELLOW);cprintf("Meal Number:");
gotoxy(43,17);textcolor(YELLOW);cscanf("%d", &bev);
switch(bev)
{
case 1:price=1.00;break;
case 2:price=2.00;break;
case 3:price=3.00;break;
case 4:price=4.00;break;
case 5:price=5.00;break;
case 6:price=6.00;break;
case 7:price=7.00;break;
case 8:price=8.00;break;
case 9:price=9.00;break;
}
if(bev>9 || bev<=0)
{
goto beverage;
}
else
{
goto quant;
}
}
clrscr();
getch();
quant:
clrscr();
gotoxy(26,11);textcolor(YELLOW);cprintf(" How many? ");
gotoxy(40,11);textcolor(YELLOW);cscanf("%d", &quantity);
other:
clrscr();
getch();
gotoxy(26,12);textcolor(YELLOW);cprintf(" Do u hav another order? [Y/N]");
gotoxy(26, 13);textcolor(YELLOW);cscanf("%c", &ans);
if(ans=='y' || ans=='Y')
{
clrscr();
goto category;
}
else if(ans=='n' || ans=='N')
goto sub;
else
goto other;
sub:
clrscr();
subtotal=price * quantity;
vat=subtotal*0.12;
do
{
clrscr();
x=1;
gotoxy(31,2);textcolor(YELLOW);cprintf(" LOVE KO 'TO");
gotoxy(28,3);textcolor(YELLOW);cprintf("MCDONALD'S LIMKETKAI");
gotoxy(21,4);textcolor(YELLOW);cprintf("LAPASAN HIGHWAY, CAGAYAN DE ORO CITY");
gotoxy(19,5);textcolor(YELLOW);cprintf("OFFICIAL RECEIPT TIN-750-001-481-752 VAT");
gotoxy(18,7);textcolor(YELLOW);cprintf("MCDONALD'S LIMKETKAI TEL # 726637 / 8563693 ");
gotoxy(18,8);textcolor(YELLOW);cprintf("KS# 04 SERIAL NO. 97H04944T");
gotoxy(18,9);textcolor(YELLOW);cprintf("OFFICIAL RECEIPT NO. 04492114");
gotoxy(18,10);textcolor(YELLOW);cprintf("ORD# 2114 KS# 04 OCT.3'08 (FRI) 16:00");
switch(s)
{
case 1:gotoxy(17,12);textcolor(YELLOW);cprintf(" Hamburger %d 1.00",quantity);break;
case 2:gotoxy(17,12);textcolor(YELLOW);cprintf(" Chessburger %d 1.00",quantity);break;
case 3:gotoxy(17,12);textcolor(YELLOW);cprintf(" Double Chessburger %d 1.00",quantity);break;
case 4:gotoxy(17,12);textcolor(YELLOW);cprintf(" Big Mac %d 1.00",quantity);break;
case 5:gotoxy(17,12);textcolor(YELLOW);cprintf(" Filet-O-Fish %d 1.00",quantity);break;
}
switch(f)
{
case 1:gotoxy(17,12);textcolor(YELLOW);cprintf(" Small French Fries %d 1.00",quantity);break;
case 2:gotoxy(17,12);textcolor(YELLOW);cprintf(" Medium French Fries %d 1.00",quantity);break;
case 3:gotoxy(17,12);textcolor(YELLOW);cprintf(" Large French Fries %d 1.00",quantity);break;
}
switch(sal)
{
case 1:gotoxy(17,12);textcolor(YELLOW);cprintf(" Veggie Salad %d 1.00",quantity);break;
case 2:gotoxy(17,12);textcolor(YELLOW);cprintf(" Salad with Grilled Chicken %d 1.00",quantity);break;
case 3:gotoxy(17,12);textcolor(YELLOW);cprintf(" Salad with Crispy Chicken %d 1.00",quantity);break;
}
switch(b)
{
case 1:gotoxy(17,12);textcolor(YELLOW);cprintf(" Egg Mcmuffin %d 1.00 ",quantity);break;
case 2:gotoxy(17,12);textcolor(YELLOW);cprintf(" Sausage Mcmuffin %d 1.00 ",quantity);break;
case 3:gotoxy(17,12);textcolor(YELLOW);cprintf(" Bacon, Egg & Cheese %d 1.00 ",quantity);break;
case 4:gotoxy(17,12);textcolor(YELLOW);cprintf(" Hotcakes %d 1.00 ",quantity);break;
}
switch(d)
{
case 1:gotoxy(17,12);textcolor(YELLOW);cprintf(" Strawberry Sundae %d 1.00",quantity);break;
case 2:gotoxy(17,12);textcolor(YELLOW);cprintf(" Hot Caramel Sundae %d 1.00 ",quantity);break;
case 3:gotoxy(17,12);textcolor(YELLOW);cprintf(" Hot Fudge Sundae %d 1.00",quantity);break;
case 4:gotoxy(17,12);textcolor(YELLOW);cprintf(" Vanilla IceCream %d 1.00",quantity);break;
case 5:gotoxy(17,12);textcolor(YELLOW);cprintf(" Coke Float %d 1.00",quantity);break;
}
switch(bev)
{
case 1:gotoxy(17,12);textcolor(YELLOW);cprintf(" Orange Juice(small) %d 1.00",quantity);break;
case 2:gotoxy(17,12);textcolor(YELLOW);cprintf(" Orange Juice(medium) %d 1.00",quantity);break;
case 3:gotoxy(17,12);textcolor(YELLOW);cprintf(" Orange Juice(large) %d 1.00 ",quantity);break;
case 4:gotoxy(17,12);textcolor(YELLOW);cprintf(" Coca-Cola (small) %d 1.00",quantity);break;
case 5:gotoxy(17,12);textcolor(YELLOW);cprintf(" Coca-Cola (medium) %d 1.00",quantity);break;
case 6:gotoxy(17,12);textcolor(YELLOW);cprintf(" Coca-Cola (large) %d 1.00",quantity);break;
case 7:gotoxy(17,12);textcolor(YELLOW);cprintf(" Ice tea(small) %d 1.00",quantity);break;
case 8:gotoxy(17,12);textcolor(YELLOW);cprintf(" Ice tea(medium) %d 1.00",quantity);break;
case 9:gotoxy(17,12);textcolor(YELLOW);cprintf(" Ice tea(large) %d 1.00",quantity);break;
}
gotoxy(44,15);textcolor(YELLOW);cprintf("TOTAL %.2f",subtotal);
gotoxy(44,17);textcolor(YELLOW);cprintf("Cash Tend ");
gotoxy(59,17);textcolor(YELLOW);cscanf("%f",&cash);
if(cash>=subtotal)
{
change=cash-subtotal;
x=0;
}
}while(x==1);
clrscr();
getch();
gotoxy(31,2);textcolor(YELLOW);cprintf(" LOVE KO 'TO");
gotoxy(28,3);textcolor(YELLOW);cprintf("MCDONALD'S LIMKETKAI");
gotoxy(21,4);textcolor(YELLOW);cprintf("LAPASAN HIGHWAY, CAGAYAN DE ORO CITY");
gotoxy(19,5);textcolor(YELLOW);cprintf("OFFICIAL RECEIPT TIN-750-001-481-752 VAT");
gotoxy(18,7);textcolor(YELLOW);cprintf("MCDONALD'S LIMKETKAI TEL # 726637 / 8563693 ");
gotoxy(18,8);textcolor(YELLOW);cprintf("KS# 04 SERIAL NO. 97H04944T");
gotoxy(18,9);textcolor(YELLOW);cprintf("OFFICIAL RECEIPT NO. 04492114");
gotoxy(18,10);textcolor(YELLOW);cprintf("ORD# 2114 KS# 04 OCT.3'08 (FRI) 16:00");
switch(s)
{
case 1:gotoxy(17,12);textcolor(YELLOW);cprintf(" Hamburger %d 1.00",quantity);break;
case 2:gotoxy(17,12);textcolor(YELLOW);cprintf(" Chessburger %d 1.00",quantity);break;
case 3:gotoxy(17,12);textcolor(YELLOW);cprintf(" Double Chessburger %d 1.00",quantity);break;
case 4:gotoxy(17,12);textcolor(YELLOW);cprintf(" Big Mac %d 1.00",quantity);break;
case 5:gotoxy(17,12);textcolor(YELLOW);cprintf(" Filet-O-Fish %d 1.00",quantity);break;
}
switch(f)
{
case 1:gotoxy(17,12);textcolor(YELLOW);cprintf(" Small French Fries %d 1.00",quantity);break;
case 2:gotoxy(17,12);textcolor(YELLOW);cprintf(" Medium French Fries %d 1.00",quantity);break;
case 3:gotoxy(17,12);textcolor(YELLOW);cprintf(" Large French Fries %d 1.00",quantity);break;
}
switch(sal)
{
case 1:gotoxy(17,12);textcolor(YELLOW);cprintf(" Veggie Salad %d 1.00",quantity);break;
case 2:gotoxy(17,12);textcolor(YELLOW);cprintf(" Salad with Grilled Chicken %d 1.00",quantity);break;
case 3:gotoxy(17,12);textcolor(YELLOW);cprintf(" Salad with Crispy Chicken %d 1.00",quantity);break;
}
switch(b)
{
case 1:gotoxy(17,12);textcolor(YELLOW);cprintf(" Egg Mcmuffin %d 1.00 ",quantity);break;
case 2:gotoxy(17,12);textcolor(YELLOW);cprintf(" Sausage Mcmuffin %d 1.00 ",quantity);break;
case 3:gotoxy(17,12);textcolor(YELLOW);cprintf(" Bacon, Egg & Cheese %d 1.00 ",quantity);break;
case 4:gotoxy(17,12);textcolor(YELLOW);cprintf(" Hotcakes %d 1.00 ",quantity);break;
}
switch(d)
{
case 1:gotoxy(17,12);textcolor(YELLOW);cprintf(" Strawberry Sundae %d 1.00",quantity);break;
case 2:gotoxy(17,12);textcolor(YELLOW);cprintf(" Hot Caramel Sundae %d 1.00 ",quantity);break;
case 3:gotoxy(17,12);textcolor(YELLOW);cprintf(" Hot Fudge Sundae %d 1.00",quantity);break;
case 4:gotoxy(17,12);textcolor(YELLOW);cprintf(" Vanilla IceCream %d 1.00",quantity);break;
case 5:gotoxy(17,12);textcolor(YELLOW);cprintf(" Coke Float %d 1.00",quantity);break;
}
switch(bev)
{
case 1:gotoxy(17,12);textcolor(YELLOW);cprintf(" Orange Juice(small) %d 1.00",quantity);break;
case 2:gotoxy(17,12);textcolor(YELLOW);cprintf(" Orange Juice(medium) %d 1.00",quantity);break;
case 3:gotoxy(17,12);textcolor(YELLOW);cprintf(" Orange Juice(large) %d 1.00 ",quantity);break;
case 4:gotoxy(17,12);textcolor(YELLOW);cprintf(" Coca-Cola (small) %d 1.00",quantity);break;
case 5:gotoxy(17,12);textcolor(YELLOW);cprintf(" Coca-Cola (medium) %d 1.00",quantity);break;
case 6:gotoxy(17,12);textcolor(YELLOW);cprintf(" Coca-Cola (large) %d 1.00",quantity);break;
case 7:gotoxy(17,12);textcolor(YELLOW);cprintf(" Ice tea(small) %d 1.00",quantity);break;
case 8:gotoxy(17,12);textcolor(YELLOW);cprintf(" Ice tea(medium) %d 1.00",quantity);break;
case 9:gotoxy(17,12);textcolor(YELLOW);cprintf(" Ice tea(large) %d 1.00",quantity);break;
}
gotoxy(44,15);textcolor(YELLOW);cprintf("TOTAL %.2f",subtotal);
gotoxy(44,16);textcolor(YELLOW);cprintf("TAX INCLUDED %.2f",vat);
gotoxy(44,17);textcolor(YELLOW);cprintf("CASH TEND %.2f",cash);
gotoxy(44,18);textcolor(YELLOW);cprintf("CHANGE %.2f",change);
gotoxy(26,20);textcolor(YELLOW);cprintf("THANK YOU! PLEASE COME AGAIN!");
gotoxy(23,21);textcolor(YELLOW);cprintf("THIS SERVES AS AN OFFICIAL RECEIPT");
gotoxy(27,22);textcolor(YELLOW);cprintf("FOR DELIVERIES, PLEASE CALL ");
gotoxy(35,23);textcolor(YELLOW);cprintf("858-6236");
getch();
}
ill understand if you'll scream by the time you saw my code T_T