悠悠同学网www.uuclass.com
酒店管理系统C++源代码----仅供参考学习,切勿用于任何商业用途
# include
//*****************************************************************
//*****************************************************************
// CLASS NAME : MENU
// DETAILS
一 需求分析 (1)顾客
1 查看房间信息(空房号,等级,床位数) 2 入住(房号,姓名,身份证) 3 退房(结账) (2) 管理员
1 查看房间信息(空房号,房间状态,等级,床位数) 2 入住(房号,改变房间状态,登记人) 3 退房(结账,登记人) 二 实体 1 房间:: 号码 c_room 等级 c_dank 床数 c_nbed 状态 c_statds 价格 c_rate
2 顾客:: 身份证 id 人数 m 要求等级 r 入住房间 room
//这个时候不知道是设计类还是功能模块
悠悠同学网www.uuclass.com
三 程序流程
1. 管理员登陆 2. 选择功能
1. 登记入住 void check_in(); 2. 退房 void check_out(); 3. 定房 void book(); 4. 订房
3. 管理员退出 四 功能模块 1 顾客模块 1)登记入住
1 输入人数m和房间等级要求r 2 按r搜索空房 再按m搜索 3 如果有符合条件的显示 4 如果没有则给出优化方案 5 选择房间
6 给出每个人每天要付的费用dayrent 7 登记个人信息 8 改变房间状态 2)退房
1 计算每人应付费用和总共费用 2 改变房间状态 3)订房
1 输入人数m 房间等级要求r 2 按r搜索空房 再按m搜索 3 如果有符合条件的显示 4 如果没有则给出优化方案 5 选择房间 2 管理员模块 1)登录系统
1 输入用户名和密码 2 检验密码
3 通过/重新输入 2)登记入住(同上) 3)退房(同上) 4)订房(同上) 5)房间信息管理
1 显示空房及对应的等级空房 2 显示已订房号码及开始入住日期
悠悠同学网www.uuclass.com
: IT CONTROLS OVER ALL THE FUNCTIONS //*****************************************************************
class menu
{ public :
void main_menu(void); void startup(void); void box(void);
void line_hor(int, int, int, char); void line_ver(int, int, int, char);
};
//*****************************************************************
// CLASS NAME : HKEEP
// DETAILS : IT CONTROLS OVER ALL FUNCTIONS
// RELATED TO HKEEP //*****************************************************************
class hkeep
{ public :
hkeep(void); ~hkeep(void); void add(void); void modify(void); void deletion(void); void display_list(void);
private :
void display_record(int); int found_record(int); void delete_record(int); void modify_record(int);
int recordno(int); int last_code(void);
int code;
char name[20],roomno[10],order[99];
};
//*****************************************************************
// CLASS NAME : MENU // FUNCTION NAME : LINE_HOR
// DETAILS : IT ACCEPTS THE ROWS AND COLUMNS AND
// DRAWS HORIZONTAL LINES
悠悠同学网www.uuclass.com
//*****************************************************************
void menu :: line_hor(int column1, int column2, int row, char c)
{
for(column1;column1<=column2;column1++)
{
//gotoxy(column1,row);
cout< } } //***************************************************************** // CLASS NAME : MENU // FUNCTION NAME : LINE_VER // DETAILS : IT ACCEPTS ROWS AND COLUMNS AND // DRAWS THE VERTICAL LINE //***************************************************************** void menu :: line_ver(int row1, int row2, int column, char c) { for(row1;row1<=row2;row1++) { gotoxy(column, row1); cout << c; } } //***************************************************************** // CLASS NAME : MENU // FUNCTION NAME : STARTUP // DETAILS : IT CREATES THE STARTING SCREEN //***************************************************************** void menu :: startup(void) { // clrscr(); int i,j,s; char a[] = \ char b[] = \M*A*N*A*G*E*M*E*N*T\ for(i=0;i<=79;i++) line_ver(1,25,i,179); // gotoxy(1,11);clreol(); 悠悠同学网www.uuclass.com gotoxy(1,13);clreol(); j = 63; s = 100; for(i=1;i<=43;i++) { sound(s); s = s+20; delay(50); gotoxy(1,12); clreol(); gotoxy(i,12); cout< } // nosound(); delay(100); char ch = 219; s = 500; for(i=0;i<=79;i++) { sound(s); s =s+10; gotoxy(i,10); cout< } nosound(); delay(200); ch = 219; s = 1290; for(i = 79; i>=1;i--) { sound(s); s = s- 10; gotoxy(i,14); cout< } nosound(); delay(1000);