天津财经大学自动选菜系统【未完善敬请期待】

这是一个用C++编写的程序,模拟为用户随机选择天津财经大学的食堂楼层和菜品。用户可以选择公寓食堂模式或全餐厅模式,程序会根据设定的选项进行随机推荐。目前仅限于作者宿舍常去的食堂和菜品,其他餐厅功能未开发。
摘要由CSDN通过智能技术生成
#include<stdio.h>//c
#include<iostream>//c++
#include<time.h>//time() head
#include<iomanip>//setw() head
#include<stdlib.h>//rand() and srand() head
using namespace std;//cout and cin before

void Apartment();
void West();
void East();
void Out();
void two();
void Over();
void Select();
void Main();


void Apartment()
{
	const char* Apartment[] = { "1楼","2楼","3楼" };
	const char* OneFloor[] = { "桂林米粉","豚骨面" };
	const char* TwoFloor[] = { "快餐","烤盘饭","干锅饭","小酥肉饭系列","拌饭","鸡排饭" };
	const char* ThreeFloor[] = { "三师兄自选菜","石锅饭","麻辣香锅","黄焖鸡米饭" };
	int n;
	cout << "系统自动为你选择的楼层为:" << endl;
	srand((unsigned)time(NULL));
	n = rand() % 3 + 1;
	cout << Apartment[n - 1] << endl;
	cout << "系统为你选择该楼层的食品为:" << endl;
	switch (n)
	{
	case 1:
		cout << OneFloor[rand() % 1 + 0] << endl;
		break;
	case 2:
		cout << TwoFloor[rand() % 6 + 0] << endl;
		break;
	case 3:
		cout << ThreeFloor[rand() % 3 + 0] << endl;
		break;
	}
	Over();
}

void East()
{
	cout << "wait~" << endl;
	Over();
}

void West()
{
	cout << "wait~" << endl;
	Over();
}

void Out()
{
	cout << "wait~" << endl;
	Over();
}

void two()
{
	const char* Where[] = { "东院食堂","学生公寓食堂","西院食堂","去外面吃" };
	int n;
	cout << "系统为你选择的地点为:" << endl;
	srand((unsigned)time(NULL));
	n = rand() % 4 + 1;
	cout << Where[n - 1] << endl;
	switch (n)
	{
	case 1:
		East();
		break;
	case 2:
		Apartment();
		break;
	case 3:
		West();
		break;
	case 4:
		Out();
		break;
	}
}

void Main()
{
	int n;
	cout << "1.学生公寓食堂模式(适用于喜欢宅的uu们)" << endl;
	cout << "2.全餐厅模式(可以排到公寓区以外的美食哦)" << endl;
	cout << "3,Select" << endl;
	cin >> n;
	switch (n)
	{
	case 1:
		cout << "" << endl;
		Apartment();
		break;
	case 2:
		cout << "" << endl;
		two();
		break;
	case 3:
		Select();
		break;
	}
}

void Over()
{
	cout << endl << "选餐完毕";
	Select();
}

void Select()
{
	int n;
	cout << "是否确认退出系统" << endl;
	cout << "1.确认" << endl;
	cout << "2.取消" << endl;
	cin >> n;
	switch (n)
	{
	case 2:cout << endl << "欢迎回到选餐系统 " << endl; ;
		Main();
		break;
	case 1:cout << "退出成功,欢迎下次登录" << endl;
		break;
	}
	cout << "" << endl;
}


int main()
{
	int n;
	cout << "Welcome to 义杰 meal selection system!" << endl << "This system is suitable for undergraduate and graduate students studying at Tianjin University of Finance and Economics, etc..." << endl << "If you are just a tourist and want to eat at Tianjin University of Finance and Economics, you can also choose this system, this system welcomes anyone!" << endl;
	cout << "Please select a mode:" << endl;
	Main();
	return 0;
}

运行结果如下

 因为本系统初衷是为了本人宿舍的成员使用,故菜品上只有我们宿舍爱吃的,而除了学生公寓餐厅其他的餐厅我们宿舍不去,所以没花时间做,代码显示都是wait~

所以,敬请期待!!!!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值