c语言机房收费系统.docxVIP

  • 0
  • 0
  • 约1.46万字
  • 约 25页
  • 2026-02-27 发布于四川
  • 举报

c语言机房收费系统

```c

includestdio.h

includestdlib.h

includestring.h

includetime.h

includectype.h

includeconio.h

defineMAX_USERS1000

defineMAX_ROOMS50

defineMAX_SEATS200

defineMAX_TRANSACTIONS5000

defineMAX_USERNAME20

defineMAX_PASSWORD20

defineMAX_NAME50

defineMAX_PHONE15

defineMAX_ADDRESS100

defineFILENAME_USERSusers.dat

defineFILENAME_ROOMSrooms.dat

defineFILENAME_SEATSseats.dat

defineFILENAME_TRANSACTIONStransactions.dat

defineFILENAME_SETTINGSsettings.dat

typedefstruct{

intid;

charusername[MAX_USERNAME];

charpassword[MAX_PASSWORD];

charname[MAX_NAME];

charphone[MAX_PHONE];

charaddress[MAX_ADDRESS];

introle;//1:admin,2:student,3:teacher

intstatus;//0:inactive,1:active

time_tregister_time;

time_tlast_login;

}User;

typedefstruct{

intid;

introom_id;

intseat_number;

intstatus;//0:available,1:occupied,2:reserved

intuser_id;

time_tstart_time;

time_tend_time;

doublefee;

}Seat;

typedefstruct{

intid;

charname[MAX_NAME];

intcapacity;

intavailable_seats;

doubleprice_per_hour;

chardescription[200];

intstatus;//0:closed,1:open

}Room;

typedefstruct{

intid;

intuser_id;

introom_id;

intseat_id;

time_tstart_time;

time_tend_time;

doubleamount;

intpayment_status;//0:unpaid,1:paid,2:refunded

charpayment_method[20];//cash,card,alipay,wechat

}Transaction;

typedefstruct{

doublestudent_discount;

doubleteacher_discount;

doublepeak_hour_multiplier;

intpeak_hour_start;

intpeak_hour_end;

doubledaily_limit;

doublemonthly_limit;

}SystemSettings;

Userusers[MAX_USERS];

Roomrooms[MAX_ROOMS];

Seatseats[MAX_SEATS*MAX_ROOMS];

Transactiontransactions[MAX_TRANSACTIONS];

Syste

文档评论(0)

1亿VIP精品文档

相关文档