Starting from:
$26.99

$20.99

Cyber café system Assignment #3 Solution

Problem Specification:

 
For this assignment, you are required to develop an application to maintain a cyber café system.  Assume that your cyber café contains several rooms where each room may contain several computer stations. Each room and computer station is numbered. When a user is assigned to a station, a record is kept which contains the user id, login time, and logout time. At the end of a session, the charge is calculated according to the time duration a user have used the computer station.

 

When your program starts, it should generate a two-dimensional array based on the number of rooms and number of computers in each room provided (read from the standard input). The rows will represent the rooms (numbered from 1 to total number of rooms) and the columns of each row will represent the computer station (numbered from 1 to total number of computers). Each element should store a record of the user using the station.

 

A display to show the status of each computer station in each room should be shown so that you can monitor the usage from a main terminal. When the program starts, the display may look like follows.

 

 

Lab Number        Computer Stations

----------------         ---------------------------------------------------------------------------------------------------

         1                  1: empty      2: empty          3: empty          4: empty                     

         2                  1: empty      2: empty          3: empty          4: empty          5: empty          6: empty         

         3                  1: empty      2: empty          3: empty          4: empty          5: empty                     

         4                  1: empty      2: empty          3: empty                                 

-------------------------------------------------------------------------------------------------------------------------

 

The program should then proceed to show a menu to allow the administrator to simulate the usage of the computers in the cyber café by manually typing in the login or logout data. Whenever someone logs in or out, the display should be updated. The following shows a sample display after two updates have been done.

 

Lab Number        Computer Stations

----------------         ---------------------------------------------------------------------------------------------------

         1                  1: empty      2: empty          3: empty          4: empty                     

         2                  1: 22335      2: empty          3: empty          4: empty          5: empty          6: empty         

         3                  1: empty      2: empty          3: empty          4: 23412          5: empty                     

         4                  1: empty      2: empty          3: empty                                 

-------------------------------------------------------------------------------------------------------------------------

 

The display above shows that computer station number 1 in lab number 2 and computer station number 4 in lab number 3 is being occupied by user with id 22335 and 23412 respectively.

 

When a user logs on, the user id, lab number, the computer station number, and the login time is entered as input. The array is updated with this information and a new display is shown. Similarly, when a user logs out, the lab number, computer station number, and logout time is entered. The display is updated and in addition to that, the total charge for this user is displayed. You may decide on the appropriate charge per hour to simulate this. Before the array is updated, write the record of the user to a log (created as a text file to contain all the records of the users in the cyber café).

 

The menu should also allow the administrator to search the position (the lab number and computer station number) of a user by entering the user id, list all user information in a lab (allow the administrator to enter the lab number), and display the total charges for the day.

 

Use modular programming and place your code in appropriate interface file, implementation file, and driver program.

 

 
 

Assessment Criteria:

 

Assessment Criteria
Marks Allocated
Correctness
1
Coding
3
Readability and Documentation
1
Output (clear and well formatted)
1
 
 
Total
6



 

Submission:
 

You are to submit the softcopy of the project containing all files (.cpp, .h, and sample text files used) to Moodle.

More products