Programming / Computing

Ice Cream Parlour

 This program imitates a ice cream parlor and asks for the user input and based on the user input it shows the output bill according to it ................................................................................................................................................................................

 

 

 

#include<stdio.h>

#include<conio.h>

#define PRT printf("Choose the flavour\n1 for vanilla\n2 for choclate\n3 for straberry\n4 for butter scotch\n 5 for black berry\n")

 

void main()

{

int m,s,amt;

 

clrscr();

gotoxy(30,10);

printf("Welcome to Gp\'s ICE CREAM PARLOUR\n\n\n");

printf("enter your choice\n1 for stick ice cream\n2 for cone\n3 for cup\n 4 for brick\n");

fflush(stdin);

scanf("%d",&m);

 

switch(m)

{

case 1:

PRT;

fflush(stdin);

scanf("%d",&s);

 

switch(s)

{

case 1:

amt = 20;

break;

case 2:

amt = 25;

break;

case 3:

amt = 20;

break;

case 4:

amt = 30;

break;

case 5:

amt = 40;

break;

}

break;

 

case 2:

PRT;

fflush(stdin);

scanf("%d",&s);

 

switch(s)

{

case 1:

amt = 25;

break;

case 2:

amt = 30;

break;

case 3:

amt = 25;

break;

case 4:

amt = 35;

break;

case 5:

amt = 45;

break;

}

break;

 

case 3:

PRT;

fflush(stdin);

scanf("%d",&s);

 

switch(s)

{

case 1:

amt = 25;

break;

case 2:

amt = 30;

break;

case 3:

amt = 25;

break;

case 4:

amt = 35;

break;

case 5:

amt = 45;

break;

}

break;

 

case 4:

PRT;

fflush(stdin);

scanf("%d",&s);

 

switch(s)

{

case 1:

amt = 60;

break;

case 2:

amt = 75;

break;

case 3:

amt = 60;

break;

case 4:

amt = 80;

break;

case 5:

amt = 100;

break;

}

break;

}

 

printf("Your total bill is %d \n",amt);

 

}

© 2010 All rights reserved.

Make a free websiteWebnode