Input: choice
Process: comparing choice with coffee menu
Output: choice of customer drink
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
int main()
{
char choice; // for user's choice
do
{
// Greeting user
printf("Welcome to my program!\n");
printf("1.Latte\n2.Cappuccino\n3.Americano\n4.Espresso\n5.Chocolate\n");
printf("e.Exit the program \n");
printf("Please pick your choice:");
// getting user's pick
choice=getche();
//check what's the order
switch (choice)
{
case '1': //do what you have to if user pick 1
printf("\nHere is your cup of latte.\n");
break;
case '2': //do what you have to if user pick 2
printf("\nHere is your cup of cappuccino.\n");
break;
case '3': //do what you have to if user pick 3
printf("\nHere is your cup of americano.\n");
break;
case '4': //do what you have to if user pick 4
printf("\nHere is your cup of espresso.\n");
break;
case '5': //do what you have to if user pick 5
printf("\nHere is your cup of chocolate.\n");
break;
}
}while (choice!='e');
printf("BYE!");
return 0;
}