Question: C Language Programming Project Topic Data structue Struct CusInfo { Char name[20]; //customer name Int sex; Char tel[11]; //phone number }CInfo; PC info structure: Struct

C Language Programming Project Topic

  1. Data structue

Struct CusInfo

{

Char name[20]; //customer name

Int sex;

Char tel[11]; //phone number

}CInfo;

PC info structure:

Struct

{

Int State[6]; // PC position status, every two hours is one period,

// from 08:00 to 20:00, totally for 6 periods.

// 0 means available period, 1 means not.

CInfo waitlist[6]; // Customers in every period

Int year;

Int month;

Int day; // Date

}PCInfo;

PCInfo info[100]; //store 100 days position info

  1. Implemention

1Browse

Input time, traverse the array info, check dateyear/month/day, if date matched, output the PC position info.

2Position Booking

Input date or time period, check PC position status file, if date matched, check status then. If the value is 0, reserve this period for the custome ( put the customer info into waitlist ). If the value is 1, check other periods on that day, find the closest period.

3Cancel Booking

Find the booking record in terms of booking date and customer info inputted, delete the booking record and reset the period status with 0.

4Inquiry

Input a date and period, check the status of the period. If the status is 1, output the booked customer info. Otherwise, output The period is available!

han 100 frequent words.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!