C++实现简单酒店管理系统
作者:J@sur 发布时间:2021-07-31 13:52:40
本文实例为大家分享了C++实现简单酒店管理系统的具体代码,供大家参考,具体内容如下
酒店管理系统设计报告
一、 需求分析
题目要求如下:
某酒店有客房若干间,其中客房分为不同等级,如豪华、标准、普通等,客房床位数也不同。例如,豪华套房有4个床位,400元/晚;标准客房2个床位,200元/晚;普通客房1个床位,100元/晚。
顾客分金卡会员、银卡会员、普通会员及非会员,其享受的折扣不同。例如,金卡会员可享受8折优惠,银卡会员可享受9折优惠,普通会员享受95折优惠,非会员不享受优惠。
当顾客连续入住多天时,也可享受一定的折扣。例如,当顾客连续入住24晚时,可享受9折优惠;连续入住58晚时,可享受85折优惠;连续入住9晚以上时,可享受8折优惠。
采用面向对象的思想,建立系统中清晰的类,分析和定义各个类,每个类中要有各自的属性和方法,并开发一套客房管理系统,实现如下功能:
(1) 管理员:以管理员身份登录系统,查询当前客房入住及预订情况,并设置客房价格、顾客优惠政策等;
(2) 酒店前台:以前台身份登录系统,查询当前客房入住及预订情况,为顾客办理入住、退房、换房等服务;顾客退房后为顾客计算消费金额并收费;
(3) 顾客:可以注册和登录系统,用户在查找到心仪的客房后,登录酒店客房管理系统可提交订单实现客房预订;未入住酒店前1天,可取消客房预订;顾客入住退房后可评论。
二、 类图设计及说明
这里的customer类名打错了
三、 系统功能设计
1、系统可以三种用户登录,分别为管理员、前台工作人员、客户,管理员需要特殊管理员账户才可以登录,客户需要注册账号才可以登录系统,用户登录成功后转至前台工作人员为其服务。
2、 管理人员页面有查询房间状态,设置优惠政策,新建房间等选项。
① 查询房间状态:返回所有房间号,房间类型和当前状态
② 设置优惠政策:对已有的区间设置打折力度
③ 新建房间:通过房间号和房间类型来新建房间
3、 前台页面提供客房查询,办理入住,提前预约,办理退房等功能
① 查询客房信息:向用户提供房间信息来选择。
② 办理入住:获取用户入住时间和离开时间为客户办理入住。
③ 提前预约:获取用户入住时间和离开时间为客户提前预约。
④ 办理退房:获取退房房间号,办理退房并且返回客户需付费金额。
4、客户界面,无账号注册账号,通过账号密码的形式登录,登录成功后转至前台页面。
四、实现流程
五、 结果演示
1、 首页
2、 管理员
登录管理员页面
创建房间
依次创建五个房间(创建数量小于40)
可查询当前的状态
设置优惠政策
3、 前台
查询当前房间状态
输入入住时间和退房时间,会显示当前房间状态,可进行选择,选择后会更具入住时间长短显示客户所享受的优惠政策,8折(此前在管理员状态设置过)
房间状态变为有客
若入住有客的房间,会显示已经有客人了,选择其他房间
预约房间也是同理
并且房间变成已经被预约
退房,入住7天豪华房间400x7=2800,但是享受8折,因此收费2240,缴费后可以留下评论
并且此时房间状态也变成了空
4、 客户
客户平台
注册账号
登录账号,登录成功转到前台
如果输入不存在的账号,会报错
六、 问题及解决
中途遇见了一个问题想了很久,客户请求入住后通过reception类入住,reception类中是通过改变room类型实现的,然而每次入住后房间的状态在reception类中已经改变,却在查询时没有变化,最后将reception类的checkin函数改为返回room类型才成功,当然预约和退房也是同理。原来客户提交的申请在reception类中创建一个新的room,并不是我们想要操作的room,因此需要返回修改后的房间才可以得到正确的结果。
七、 附录
设计代码如下:
#include<iostream>
using namespace std;
#include<string>
enum Type { luxury, standard, ordinary };
enum Status { used, reserved, empty1 };
struct Time {
? ? int year;
? ? int month;
? ? int day;
};
class room {
public:
? ? room(int roomNo, Type roomType) {
? ? ? ? roomID = roomNo;
? ? ? ? type = roomType;
? ? ? ? roomStatus = empty1;
? ? ? ? if (type == luxury) {
? ? ? ? ? ? price = 400;
? ? ? ? ? ? name = "豪华间";
? ? ? ? }
? ? ? ? else if (type == standard) {
? ? ? ? ? ? price = 200;
? ? ? ? ? ? name = "标准间";
? ? ? ? }
? ? ? ? else if (type == ordinary) {
? ? ? ? ? ? price = 100;
? ? ? ? ? ? name = "普通间";
? ? ? ? }
? ? };
? ? room() {};
? ? //显示房间当前信息
? ? void showInformation() {
? ? ? ? cout << "房间号:" << roomID << endl;
? ? ? ? cout << "类型:" << name << endl;
? ? ? ? if(roomStatus == 0)
? ? ? ? ? ? cout << "当前状态:有客" <<endl;
? ? ? ? else if(roomStatus == 1)
? ? ? ? ? ? cout << "当前状态:已被预约" << endl;
? ? ? ? else
? ? ? ? ? ? cout << "当前状态:空房间" << endl;
? ? ? ? cout << endl;
? ? }
? ? //办理入住
? ? void checkIn(Time beginTime, Time endTime) {
? ? ? ? this->begin = beginTime;
? ? ? ? this->end = endTime;
? ? ? ? this->roomStatus = used;
? ? }
? ? void roomReserved(Time beginTime, Time endTime) {
? ? ? ? roomStatus = reserved;
? ? ? ? begin = beginTime;
? ? ? ? end = endTime;
? ? };
? ? //办理退房
? ? float checkOut() {
? ? ? ? roomStatus = empty1;
? ? ? ? int day = (end.year - begin.year) * 365 + (end.month - begin.month) * 30 + (end.day - begin.day);
? ? ? ? float polity;
? ? ? ? if (day > 2 && day <= 4) {
? ? ? ? ? ? polity = polity1;
? ? ? ? }
? ? ? ? else if (day >= 5 && day <= 8) {
? ? ? ? ? ? polity = polity2;
? ? ? ? }
? ? ? ? else if (day >= 9) {
? ? ? ? ? ? polity = polity3;
? ? ? ? }
? ? ? ? else {
? ? ? ? ? ? polity = 1;
? ? ? ? }
? ? ? ? float money = ((end.year - begin.year) * 365 + (end.month - begin.month) * 30 + (end.day - begin.day))*price*polity;
? ? ? ? return money;
? ? }
? ? int showstatus() {
? ? ? ? return roomStatus;
? ? }
? ? int getRno(){
? ? ? ? return roomID;
? ? }
? ? void setPolity(float a, float b, float c) {
? ? ? ? polity1 = a;
? ? ? ? polity2 = b;
? ? ? ? polity3 = c; ? ? ? ?
? ? }
? ? int getRoomnumber() {
? ? ? ? return roomnumber;
? ? }
? ? friend class manager;
? ? friend class reception;
private:
? ? int roomID;
? ? static float polity1;
? ? static float polity2;
? ? static float polity3;
? ? static int roomnumber;
? ? Type type;
? ? string name;
? ? float price;
? ? Status roomStatus;
? ? Time begin;
? ? Time end;
};
class manager {
public:
? ? manager() {};
? ? room roomcreate(int No, Type roomtype) {
? ? ? ? room Room(No, roomtype);
? ? ? ? Room.roomnumber++;
? ? ? ? return Room;
? ? }
? ? void checkInformation(room Room) {
? ? ? ? Room.showInformation();
? ? }
? ? void setPolity() {
? ? ? ? room Room1;
? ? ? ? float a, b, c;
? ? ? ? cout << "请分别设置入住2-4天,5-8天或9天以上的优惠政策,用1以内小数表示打折力度" << endl;
? ? ? ? cin >> a >> b >> c;
? ? ? ? Room1.setPolity(a, b, c);
? ? ? ? cout << "设置成功" << endl;
? ? };
};
class reception {
public:
? ? reception(int no) {
? ? ? ? NO = no;
? ? }
? ? void checkInformation(room Room) {
? ? ? ? Room.showInformation();
? ? }
? ? room CheckIn(Time begin, Time end, room Room) {
? ? ? ? if (Room.showstatus() == empty1) {
? ? ? ? ? ? Room.checkIn(begin, end);
? ? ? ? ? ? cout << "预定成功!时间:" << begin.year << "年" << begin.month << "月" << begin.day << "日---" << end.year << "年" << end.month << "月" << end.day << "日" << endl;
? ? ? ? ? ? int day = (end.year - begin.year) * 365 + (end.month - begin.month) * 30 + (end.day - begin.day);
? ? ? ? ? ? if (day > 2 && day <= 4) {
? ? ? ? ? ? ? ? polity = Room.polity1;
? ? ? ? ? ? }
? ? ? ? ? ? else if (day >= 5 && day <= 8) {
? ? ? ? ? ? ? ? polity = Room.polity2;
? ? ? ? ? ? }
? ? ? ? ? ? else if (day >= 9) {
? ? ? ? ? ? ? ? polity = Room.polity3;
? ? ? ? ? ? }
? ? ? ? ? ? else {
? ? ? ? ? ? ? ? polity = 1;
? ? ? ? ? ? }
? ? ? ? ? ? if (polity < 1)
? ? ? ? ? ? ? ? cout << "优惠打" << polity * 10 << "折" << endl;
? ? ? ? }
? ? ? ? else {
? ? ? ? ? ? cout << "房间已经被预定,请选择其他房间" << endl;
? ? ? ? }
? ? ? ? return Room;
? ? }
? ? int getID() {
? ? ? ? return NO;
? ? }
? ? room CheckOut(room Room) {
? ? ? ? float money = Room.checkOut();
? ? ? ? cout << "退房成功" << endl;
? ? ? ? cout << "请支付:" << money << "元"<<endl;
? ? ? ? return Room;
? ? }
? ? room Reserved(Time begin, Time end, room Room) {
? ? ? ? if (Room.showstatus() == empty1) {
? ? ? ? ? ? Room.roomReserved(begin, end);
? ? ? ? ? ? cout << "预定成功!时间:" << begin.year << "年" << begin.month << "月" << begin.year << "日---" << end.year << "年" << end.month << "月" << end.day << "日" << endl;
? ? ? ? ? ? int day = (end.year - begin.year) * 365 + (end.month - begin.month) * 30 + (end.day - begin.day);
? ? ? ? ? ? if (day > 2 && day <= 4) {
? ? ? ? ? ? ? ? polity = Room.polity1;
? ? ? ? ? ? }
? ? ? ? ? ? else if (day >= 5 && day <= 8) {
? ? ? ? ? ? ? ? polity = Room.polity2;
? ? ? ? ? ? }
? ? ? ? ? ? else if (day >= 9) {
? ? ? ? ? ? ? ? polity = Room.polity3;
? ? ? ? ? ? }
? ? ? ? ? ? else {
? ? ? ? ? ? ? ? polity = 1;
? ? ? ? ? ? }
? ? ? ? ? ? if (polity < 1)
? ? ? ? ? ? ? ? cout << "优惠打" << polity * 10 << "折" << endl;
? ? ? ? }
? ? ? ? else {
? ? ? ? ? ? cout << "房间已经被预定,请选择其他房间" << endl;
? ? ? ? }
? ? ? ? return Room;
? ? }
private:
? ? int NO;
? ? float polity;
};
class customer {
public:
? ? customer(){}
? ? customer(int Count, int Key) {
? ? ? ? count = Count;
? ? ? ? key = Key;
? ? ? ? customernumber++;
? ? ? ? cout << "注册成功!" << endl;
? ? }
? ? void signin() {};
? ? void checkin(reception rec, Time begin, Time end, room Room) {
? ? ? ? rec.CheckIn(begin, end, Room);
? ? }
? ? void reserve(reception rec, Time begin, Time end, room Room) {
? ? ? ? rec.Reserved(begin, end, Room);
? ? }
? ? void ?checkout(reception rec, room Room) {
? ? ? ? rec.CheckOut(Room);
? ? }
? ? int getnumber() {
? ? ? ? return customernumber;
? ? }
? ? int getcount() {
? ? ? ? return count;
? ? }
? ? int getkey() {
? ? ? ? return key;
? ? }
private:
? ? int count;
? ? int key;
? ? static int customernumber;
};
int room::roomnumber = 0;
int customer::customernumber = 0;
float room::polity1 = 1;
float room::polity2 = 1;
float room::polity3 = 1;
int main() {
? ? int user;
? ? int rightkey = 123;
? ? manager jasur;
? ? reception wmn(1);
? ? room Baseroom;
? ? room Room[40];
? ? customer Customer[40];
? ? customer baseCusomer;
? ? string comments[40];
? ? while (true) {
? ? ? ? cout << "欢迎来到酒店预订系统,请问你是?" << endl;
? ? ? ? cout << "1.管理员 ?2.前台 ? 3.客户" << endl;
? ? ? ? cout << "请输入:" << endl;
? ? ? ? cin >> user;
? ? ? ? if (user == 1) { ? ?//管理员选项
? ? ? ? ? ? cout << "请输入管理员密码:" << endl;
? ? ? ? ? ? int key;
? ? ? ? ? ? cin >> key;
? ? ? ? ? ? if (rightkey == key) {
? ? ? ? ? ? ? ? cout << "欢迎来到管理员平台欢迎您!" << endl;
? ? ? ? ? ? ? ? while (true) {
? ? ? ? ? ? ? ? ? ? cout << "1.查询入住情况 ? 2.设置客房优惠 ?3.创建房间 ?0.退出" << endl;
? ? ? ? ? ? ? ? ? ? int selection;
? ? ? ? ? ? ? ? ? ? cout << "请输入:" << endl;
? ? ? ? ? ? ? ? ? ? cin >> selection;
? ? ? ? ? ? ? ? ? ? if (selection == 1) {
? ? ? ? ? ? ? ? ? ? ? ? for (int i = 0; i < Baseroom.getRoomnumber(); i++) {
? ? ? ? ? ? ? ? ? ? ? ? ? ? jasur.checkInformation(Room[i + 1]);
? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? else if (selection == 2) {
? ? ? ? ? ? ? ? ? ? ? ? jasur.setPolity();
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? else if (selection == 3) {
? ? ? ? ? ? ? ? ? ? ? ? int entry, Rno;
? ? ? ? ? ? ? ? ? ? ? ? cout << "输入创建房间的房间号和类型(1代表豪华间,2代表标准间,3代表普通间)" << endl;
? ? ? ? ? ? ? ? ? ? ? ? cin >> Rno >> entry;
? ? ? ? ? ? ? ? ? ? ? ? if (entry == 1)
? ? ? ? ? ? ? ? ? ? ? ? ? ? Room[Baseroom.getRoomnumber()] = jasur.roomcreate(Rno, luxury);
? ? ? ? ? ? ? ? ? ? ? ? else if (entry == 2)
? ? ? ? ? ? ? ? ? ? ? ? ? ? Room[Baseroom.getRoomnumber()] = jasur.roomcreate(Rno, standard);
? ? ? ? ? ? ? ? ? ? ? ? else if (entry == 3)
? ? ? ? ? ? ? ? ? ? ? ? ? ? Room[Baseroom.getRoomnumber()] = jasur.roomcreate(Rno, ordinary);
? ? ? ? ? ? ? ? ? ? ? ? cout << "操作成功" << endl << endl;
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? else if (selection == 0) {
? ? ? ? ? ? ? ? ? ? ? ? break;
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? }
? ? ? ? ? ? }
? ? ? ? }
? ? ? ? else if (user == 2) {
? ? ? ? ? ? cout << "欢迎来到前台服务平台" << endl;
? ? ? ? ? ? while (true) {
? ? ? ? ? ? ? ? fuwu:
? ? ? ? ? ? ? ? cout << wmn.getID() << "号服务员为您服务,本平台为您提供了如下功能:1.查询客房信息 ?2.办理入住 ?3.提前预约 ?4.办理退房 ?0.退出" << endl;
? ? ? ? ? ? ? ? cout << "请选择需要的服务" << endl;
? ? ? ? ? ? ? ? int selection;
? ? ? ? ? ? ? ? cin >> selection;
? ? ? ? ? ? ? ? if (selection == 1) {
? ? ? ? ? ? ? ? ? ? cout << "客房信息如下:" << endl;
? ? ? ? ? ? ? ? ? ? for (int i = 0; i < Baseroom.getRoomnumber(); i++) {
? ? ? ? ? ? ? ? ? ? ? ? wmn.checkInformation(Room[i + 1]);
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? else if (selection == 2) {
? ? ? ? ? ? ? ? ? ? Time begin, end;
? ? ? ? ? ? ? ? ? ? int Rno, index;
? ? ? ? ? ? ? ? ? ? cout << "输入客户入住时间:";
? ? ? ? ? ? ? ? ? ? cin >> begin.year >> begin.month >> begin.day;
? ? ? ? ? ? ? ? ? ? cout << "输入客户离开时间:";
? ? ? ? ? ? ? ? ? ? cin >> end.year >> end.month >> end.day;
? ? ? ? ? ? ? ? ? ? cout << "客房信息如下:" << endl;
? ? ? ? ? ? ? ? ? ? for (int i = 0; i < Baseroom.getRoomnumber(); i++) {
? ? ? ? ? ? ? ? ? ? ? ? wmn.checkInformation(Room[i + 1]);
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? cout << "请输入入住客房号:";
? ? ? ? ? ? ? ? ? ? cin >> Rno;
? ? ? ? ? ? ? ? ? ? for (int i = 0; i < Baseroom.getRoomnumber(); i++) {
? ? ? ? ? ? ? ? ? ? ? ? if (Room[i + 1].getRno() == Rno) {
? ? ? ? ? ? ? ? ? ? ? ? ? ? index = i + 1;
? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? Room[index] = wmn.CheckIn(begin, end, Room[index]);
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? else if (selection == 3) {
? ? ? ? ? ? ? ? ? ? Time begin, end;
? ? ? ? ? ? ? ? ? ? int Rno, index;
? ? ? ? ? ? ? ? ? ? cout << "输入客户入住时间:";
? ? ? ? ? ? ? ? ? ? cin >> begin.year >> begin.month >> begin.day;
? ? ? ? ? ? ? ? ? ? cout << "输入客户离开时间:";
? ? ? ? ? ? ? ? ? ? cin >> end.year >> end.month >> end.day;
? ? ? ? ? ? ? ? ? ? cout << "客房信息如下:" << endl;
? ? ? ? ? ? ? ? ? ? for (int i = 0; i < Baseroom.getRoomnumber(); i++) {
? ? ? ? ? ? ? ? ? ? ? ? wmn.checkInformation(Room[i + 1]);
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? cout << "请输入预约客房号:";
? ? ? ? ? ? ? ? ? ? cin >> Rno;
? ? ? ? ? ? ? ? ? ? for (int i = 0; i < Baseroom.getRoomnumber(); i++) {
? ? ? ? ? ? ? ? ? ? ? ? if (Room[i + 1].getRno() == Rno) {
? ? ? ? ? ? ? ? ? ? ? ? ? ? index = i + 1;
? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? Room[index] = wmn.Reserved(begin, end, Room[index]);
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? else if (selection == 4) {
? ? ? ? ? ? ? ? ? ? int Rno,index;
? ? ? ? ? ? ? ? ? ? cout << "请输入退房房间号:";
? ? ? ? ? ? ? ? ? ? cin >> Rno;
? ? ? ? ? ? ? ? ? ? for (int i = 0; i < Baseroom.getRoomnumber(); i++) {
? ? ? ? ? ? ? ? ? ? ? ? if (Room[i + 1].getRno() == Rno) {
? ? ? ? ? ? ? ? ? ? ? ? ? ? index = i + 1;
? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? Room[index] = wmn.CheckOut(Room[index]);
? ? ? ? ? ? ? ? ? ? cout << "欢迎留言评论您的体验:" << endl;
? ? ? ? ? ? ? ? ? ? cin >> comments[index];
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? else if (selection == 0) {
? ? ? ? ? ? ? ? ? ? break;
? ? ? ? ? ? ? ? }
? ? ? ? ? ? }
? ? ? ? }
? ? ? ? else if (user == 3) {
? ? ? ? ? ? cout << "用户你好,欢迎您来到本酒店" << endl;
? ? ? ? ? ? while (true) {
? ? ? ? ? ? ? ? cout << "请问您有本平台的账号吗?没有可以注册一个哦!" << endl;
? ? ? ? ? ? ? ? cout << "1.我已经有账号了 ? ?2.注册 ? ? 0.退出" << endl;
? ? ? ? ? ? ? ? int selection;
? ? ? ? ? ? ? ? cin >> selection;
? ? ? ? ? ? ? ? if (selection == 1) {
? ? ? ? ? ? ? ? ? ? int count, key, rightcount, index = -1;
? ? ? ? ? ? ? ? x:
? ? ? ? ? ? ? ? ? ? cout << "请输入账号:" << endl;
? ? ? ? ? ? ? ? ? ? cin >> count;
? ? ? ? ? ? ? ? ? ? for (int i = 0; i < baseCusomer.getnumber(); i++) {
? ? ? ? ? ? ? ? ? ? ? ? if (Customer[i].getcount() == count) {
? ? ? ? ? ? ? ? ? ? ? ? ? ? index = i;
? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? if (index == -1) {
? ? ? ? ? ? ? ? ? ? ? ? cout << "不存在此账号" << endl;
? ? ? ? ? ? ? ? ? ? ? ? goto x;
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? y:
? ? ? ? ? ? ? ? ? ? cout << "请输入密码:";
? ? ? ? ? ? ? ? ? ? cin >> key;
? ? ? ? ? ? ? ? ? ? for (int i = 0; i < baseCusomer.getnumber(); i++) {
? ? ? ? ? ? ? ? ? ? ? ? if (Customer[index].getkey() == key) {
? ? ? ? ? ? ? ? ? ? ? ? ? ? cout << "登录成功!" << endl;
? ? ? ? ? ? ? ? ? ? ? ? ? ? goto fuwu;
? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? else {
? ? ? ? ? ? ? ? ? ? ? ? ? ? cout << "密码错误!" << endl;
? ? ? ? ? ? ? ? ? ? ? ? ? ? goto y;
? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? else if (selection == 2) {
? ? ? ? ? ? ? ? ? ? int count, key, virity;
? ? ? ? ? ? ? ? ? ? cout << "请输入注册账号:";
? ? ? ? ? ? ? ? ? ? cin >> count;
? ? ? ? ? ? ? ? ? ? cout << endl;
? ? ? ? ? ? ? ? a:
? ? ? ? ? ? ? ? ? ? cout << "请设置密码:";
? ? ? ? ? ? ? ? ? ? cin >> key;
? ? ? ? ? ? ? ? ? ? cout << "请确认密码:";
? ? ? ? ? ? ? ? ? ? cin >> virity;
? ? ? ? ? ? ? ? ? ? if (key == virity) {
? ? ? ? ? ? ? ? ? ? ? ? customer base(count, key);
? ? ? ? ? ? ? ? ? ? ? ? Customer[baseCusomer.getnumber() - 1] = base;
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? else {
? ? ? ? ? ? ? ? ? ? ? ? cout << "两次密码不相等,重新输入" << endl;
? ? ? ? ? ? ? ? ? ? ? ? goto a;
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? else if (selection == 0) {
? ? ? ? ? ? ? ? ? ? break;
? ? ? ? ? ? ? ? }
? ? ? ? ? ? }
? ? ? ? }
? ? ? ? else {
? ? ? ? ? ? cout << "无效的选择,重新选择!";
? ? ? ? }
? ? }
? ? return 0;
}
来源:https://blog.csdn.net/weixin_44606646/article/details/111567867


猜你喜欢
- 前言在SpringBoot中,对于JavaBean的属性一般都绑定在配置文件中,比如application.properties/appli
- properties配置文件如下:human.name=Mr.Yuhuman.age=21human.gender=male如何把prope
- java 值Document解析xml详细介绍使用jar包:jdom.jar配置文件格式 global.xml一、获取输入的值组成的结点我们
- 前言什么时候需要重处理?在实际工作中,重处理是一个非常常见的场景,比如:发送消息失败,调用远程服务失败,争抢锁失败,等等,这些错误可能是因为
- // 声明LocationManager对象 LocationManager loctionManager; // 通过系统服务,取得Loc
- Java 队列实现原理“队列”这个单词是英国人说的“排”。在英国“排队”的意思就是站到一排当中去。计算机科学中,队列是一种数据结构,有点类似
- 前言Redis是一个开源的Key-Value数据缓存,和Memcached类似。Redis多种类型的value,包括string(字符串)、
- 详解android 通过uri获取bitmap图片并压缩很多人在调用图库选择图片时会在onActivityResult中用Media.get
- 1. 前言现在很多应用都有小悬浮窗的功能,比如看直播的时候,通过Home键返回桌面,直播的小窗口仍可以在屏幕上显示。下面将介绍下悬浮窗的的一
- java中Executor,ExecutorService,ThreadPoolExecutor详解1.Excutor  
- String.indexOf的模拟实现,没想象中有多么高深的查找算法,就是最普通的遍历查找思路:先找到第一个相同的字符,然后依次比较后面的字
- 前言本文主要给大家介绍了关于Spring Boot优化内嵌Tomcat的相关内容,分享出来供大家参考学习,下面话不多说了,来一看看详细的介绍
- 1.一段简单的代码首先来一段代码,这个是单例模式,可能有的人不知道什么是单例模式,我就简单说一下单例模式是指一个类有且只有一种对象实例。这里
- 其实就只有一条sql语句<select id = "search" resultType = "mate
- 本文实例为大家分享了Java利用同步块synchronized()保证并发安全的具体代码,供大家参考,具体内容如下package day10
- 异步方法很好的解决了这些问题,异步执行某个方法,程序立即开辟一个新线程去运行你的方法,主线程包括界面就不会死掉了。异步如何开始,好理解,现在
- 说明:在填写表数据时当输入完一个文本框后,输入下一个文本框时需要用Tab键切换,但是有的人喜欢用Enter键切换下一个,此方法是Enter取
- 本小节内容不多,但是个人感觉比较独立,还是拿出来单讲吧。在开发 IntelliJ Plugin 时,如果需要用到 Gson、OKHttp 等
- 导出的 Jar 包无法运行?导出的 Jar 包找不到 Main class?大概是我对导出 Jar 包的理解不深吧,反正一直不太懂 IDEA
- 前言前一阵项目中的上传图片改为上传到阿里上,记录一下实现的过程,方便以后查看。参考资料:官方文档配置Android studio添加依赖de