#include<iostream>
using namespace std;
//class Waiter
//{};
class MENU
{
private:
int num;
char name[30];
float price;
public:
MENU();
void Setmenu(int nums,char *names,float prices);
int Getnum();
char *Getname();
float Getprice();
};
class TABLE
{
private:
int i;
int order[32];
int number[32];
MENU me[32];
public:
TABLE();
void Seti(int n){i=n;}
int Geti(){return i;}
void Setorder(int orders[32]);
int *Getorder();
void Setnumber(int numbers[32]);
int *Getnumber();
void Printmenu();
void Getlassorder();
void Printlassorder();
void Getmore_order();
void Getless_order();
void GetPay();
};
class RESTAURANT
{
private:
TABLE tab[31];
public:
RESTAURANT(){}
void Service();
void Searchtable(); //查桌子
void Choose(); //选桌子
void Order(); //点菜
void More(); //加菜
void Less(); //退菜
void Pay(); //买单
};
//MENU一族的成员******************************************************
MENU::MENU()
{
num=0;
name[0]='\0';
price=0.0;
}
void MENU::Setmenu(int nums,char *names,float prices)
{
num=nums;
strcpy(name,names);
price=prices;
}
int MENU::Getnum(){return num;}
char *MENU::Getname(){return name;}
float MENU::Getprice(){return price;}
//TABLE一族的成员*****************************************************
TABLE::TABLE():i(0)
{
for(int i=0;i<32;i++)
{
order[i]=0;
number[i]=0;
}
me[1].Setmenu(1," 农家炒肉饭",10);
me[2].Setmenu(2," 爆辣鸡丁饭",15);
me[3].Setmenu(3," 葱爆肥肠饭",15);
me[4].Setmenu(4," 香辣牛肉饭",18);
me[5].Setmenu(5," 麻辣排骨饭",18);
me[6].Setmenu(6," 糖醋排骨饭",18);
me[7].Setmenu(7," 油淋排骨饭",20);
me[8].Setmenu(8," 爆炒鸡杂饭",20);
me[9].Setmenu(9," 仙鹤烩熊掌",30);
me[10].Setmenu(10,"干烧网鲍片",40);
me[11].Setmenu(11,"清汤雪耳 ",90);
me[12].Setmenu(12,"菠萝拼火鹅",50);
me[13].Setmenu(13,"月中丹桂 ",60);
me[14].Setmenu(14,"露笋拼鸡肉",70);
me[15].Setmenu(15,"凤入竹林 ",80);
me[16].Setmenu(16,"百花酿鱼肚",82);
me[17].Setmenu(17,"清汤雪耳 ",90);
me[18].Setmenu(18,"清蒸海鲜 ",90);
}
void TABLE::Setorder(int orders[32])
{
for(int i=1;i<32;i++)
order[i]=orders[i];
}
int *TABLE::Getorder()
{
int *p;
p=order;
return p;
}
void TABLE::Setnumber(int numbers[32])
{
for(int i=1;i<32;i++)
number[i]=numbers[i];
}
int *TABLE::Getnumber()
{
i
程序设计点菜
最新推荐文章于 2024-09-14 08:30:00 发布
这是一个用C++实现的餐厅点菜系统,包括MENU类、TABLE类和RESTAURANT类。MENU类定义了菜品信息,TABLE类管理了餐桌和点菜信息,RESTAURANT类实现了查桌、选桌、点菜、加菜、退菜和买单等功能。系统提供了丰富的菜品选择,并能方便地进行点餐操作。
摘要由CSDN通过智能技术生成