You are on page 1of 3

Topic:

Cafe management

CODE :

#include <iostream>

Using namespace std;

Void AddFood();

Void GenerateBill();

String foodname[20];

Int price[20], choose, count=0, foodChoice;

Int main(){

Do{

Cout<<”1. ADD FOOD”<<endl;

Cout<<”2. BUY FOOD”<<endl;

Cout<<”3. EXIT”<<endl;

Cin>>choose;

Switch(choose){

Case 1:

AddFood();

System(“CLS”);
Break;

Case 2:

System(“CLS”);

GenerateBill();

System(“PAUSE”);

System(“CLS”);

}while(choose!=3);

Return 0;

Void AddFood(){

Cout<<”Enter food name: “;

Cin>>foodname[count];

Cout<<”Enter price: “;

Cin>>price[count];

Count++;

Void GenerateBill(){

Int bill[20], count1=0, total=0;

Cout<<”FOOD NAME”<<”\t\t\t”;

Cout<<”PRICE”<<endl;

For(int i=0; i<count; i++){

Cout<<i+1<<”. “<<foodname[i]<<” “;

Cout<<”\t\t\t”<<price[i]<<endl;

}
Do{

Cout<<endl;

Cout<<”Press 0 to Generate Bill”<<endl;

Cout<<”CHOOSE FOOD: “;

Cin>>foodChoice;

Bill[count1]=foodChoice-1;

Total+=price[foodChoice-1];

If(foodChoice!=0)

Count1++;

}while(foodChoice!=0);

Cout<<endl;

Cout<<”Your bill is generating….”<<endl;

Cout<<endl;

System(“PAUSE”);

System(“CLS”);

For(int i=0; i<count1; i++){

Cout<<foodname[bill[i]]<<”\t\t\t”<<price[bill[i]]<<endl;

Cout<<”--------------------------------------------------------“<<endl;

Cout<<”TOTAL\t\t\tRs.”<<total<<endl;

Cout<<endl;

You might also like