Example this one.
CAFETERIA
[A] - Snacks
[B] - Drinks
Enter your choice:
//If they enter "A" another option will appear//
Like this:
Snacks
[A] - Snack1..............$1
[B] - Snack2..............$1
[C] - Snack3..............$1
Enter your choice:
//And then, if they choose any of these options, the name and price of the selected option should appear.//
Like this: Name of choice: Snack1
Price: $1
And then, they will be ask if they want to order some drinks.
Like this: Do you want somee drinks? [Y] or [N]
if they enter "Y" it will proceed to the Drinks option and if "N" the program will terminate.
Like this:
Drinks
[A] - Drinks1
[B] - Drinks2
[C] - Drinks3
//And vice versa, I mean if they choose "B" on the first option.. the Drinks choices should appear first.//
And I'm currently working on it.. but I can't get it..
#include<stdio.h>
#include<conio.h>
#define p printf
#define s scanf
void main()
{
clrscr();
int choice,choice2;
int a,A,b,B,c,C,y,Y,n,N;
p("\t\t\tCAFETERIA\n\n");
p("[A] - Snacks\n");
p("[B] - Drinks\n\n");
p("Enter your choice: ");
s("%s",&choice);
if(choice=='a'||choice=='A'){
p("\nSNACKS\n\n");
p("[A] - Piatos................12.00\n");
p("[B] - Nova..................15.00\n");
p("[C] - Lays..................101.00\n");
}
else if(choice=='b'||choice=='B'){
p("\nDRINKS\n\n");
p("[A] - Coke..................10.00\n");
p("[B] - Sprite................15.00\n");
p("[C] - Sparkle...............12.00\n");
}
else {
p("Error!");
}
if (choice=='a'||choice=='A'){
p("Enter letter of choice: ");
s("%d",&choice);
if (choice=='a'||choice=='A'){
p("\nName of choice: Piatos\nPrice: 12.00\n");
}
}
getch();
}
Ooops, I forgot to tell, it should be in Turbo C..
I'm just a beginner in programming

New Topic/Question
Reply



MultiQuote




|