subject

This project is adapted from Programming project 5 on Page 520 of the textbook. We practice working on dynamic arrays to solve this problem. You run four computer labs. Each lab contains certain number of computer stations to be determined at runtime.
Your program should keep track of the status of each computer station, whether it's empty or used by some user. Whenever a user (identified by 5-digit ID number) logs in or logs off, the program updates its data, and displays the new status of the lab.
In addition to the login and logoff, your program also supports a search command that looks up whether a certain user is using any computer station or not.
Your program then needs to dynamically allocate space for the current labs array of arrays using the entry in labsizes that corresponds (same index) to the labs[index] for the size. Please start with the starter code as it controls the Menu and showLabs displays.
Please implement the following functions:
void createArrays(IntPtr labs[], int labsizes[]); // should dynamically allocate the arrays.
void freeArrays(IntPtr labs[]); // should free the arrays
void search(IntPtr labs[], int labsizes[]); // should search for the user in the lab
void logout(IntPtr labs[], int labsizes[]); // should logout the user from the lab
Don't forget to add a comment at the top of the function to explain what it does.

Example output
An example execution of the program is displayed below:
Welcome to the LabMonitorProgram!
Please enter the number of computer stations in each lab:
How many computers in Lab 1?4
How many computers in Lab 2?5
How many computers in Lab 3?6
How many computers in Lab 4?4
MAIN MENU
0) Quit
1) Simulate login
2) Simulate logout
3) Search
1
Enter the 5 digit ID number of the user logging in:
33333
Enter the lab number the user is logging in from (1-4):
3
Enter computer station number the user is logging in to (1-6):
3
LAB STATUS
Lab # Computer Stations
1 1: empty 2: empty 3: empty 4: empty
2 1: empty 2: empty 3: empty 4: empty 5: empty
3 1: empty 2: empty 3: 33333 4: empty 5: empty 6: empty
4 1: empty 2: empty 3: empty
MAIN MENU
0) Quit
1) Simulate login
2) Simulate logout
3) Search
1
Enter the 5 digit ID number of the user logging in:
22222
Enter the lab number the user is logging in from (1-4):
2
Enter computer station number the user is logging in to (1-5):
2
LAB STATUS
Lab # Computer Stations
1 1: empty 2: empty 3: empty 4: empty
2 1: empty 2: 22222 3: empty 4: empty 5: empty
3 1: empty 2: empty 3: 33333 4: empty 5: empty 6: empty
4 1: empty 2: empty 3: empty

MAIN MENU
0) Quit
1) Simulate login
2) Simulate logout
3) Search
3
Enter the 5 digit ID number of the user logging in:
22222
User 22222 logged in Lab 2 at computer 2

MAIN MENU
0) Quit
1) Simulate login
2) Simulate logout
3) Search
2
Enter the 5 digit ID number of the user logging in:
11111
User not logged in.
LAB STATUS
Lab # Computer Stations
1 1: empty 2: empty 3: empty 4: empty
2 1: empty 2: 22222 3: empty 4: empty 5: empty
3 1: empty 2: empty 3: 33333 4: empty 5: empty 6: empty
4 1: empty 2: empty 3: empty 4: empty

MAIN MENU
0) Quit
1) Simulate login
2) Simulate logout
3) Search
2
Enter the 5 digit ID number of the user logging in:
33333
Logout user 33333 in Lab 3 at computer 3
LAB STATUS
Lab # Computer Stations
1 1: empty 2: empty 3: empty 4: empty
2 1: empty 2: 22222 3: empty 4: empty 5: empty
3 1: empty 2: empty 3: empty 4: empty 5: empty 6: empty
4 1: empty 2: empty 3: empty 4: empty

MAIN MENU
0) Quit
1) Simulate login
2) Simulate logout
3) Search
0
Bye!

Hints

You should work on your program so that it's always compilable: i. e, work on one function at a time, implement it, test it and modify the function until it works. Only then, you move on to next one.
Write comments to 1) document your algorithms and design, 2) make your code reabable, 3) debug code.
Started code link https://onlinegdb. com/Ad6Hu4jgS . it was too long thats why i could not paste it

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 01:40
When the pc version of the spreadsheet program became available, the ibm pc quickly became the top-selling personal computer?
Answers: 3
question
Computers and Technology, 23.06.2019 15:30
1. ask the user how many questions are in the quiz. 2. ask the user to enter the key (that is, the correct answers). there should be one answer for each question in the quiz, and each answer should be an integer. e.g., 34 7 13 100 81 3 9 10 321 12 might be the key for a 10-question quiz. you will need to store the key in an array. 3. ask the user to enter the answers for the quiz to be graded. there needs to be one answer for each question. note that these answers do not need to be stored; each answer can simply be compared to the key as it is entered. 4. when the user has entered all of the answers to be graded, print the number correct and the percent correct. 5. add a loop so that the user can grade any number of quizzes with a single key. after the results have been printed for each quiz, ask "grade another quiz? (y/n)." note: you only have one array (the key). you are not creating a new key for each set of quiz answers.
Answers: 3
question
Computers and Technology, 24.06.2019 00:30
Asecurity policy is a a. set of guidlines b. set of transmission protocols c. written document d. set of rules based on standards and guidelines
Answers: 2
question
Computers and Technology, 24.06.2019 17:00
Anew author is in the process of negotiating a contract for a new romance novel. the publisher is offering three options. in the first option, the author is paid $5,000 upon delivery of the final manuscript and $20,000 when the novel is published. in the second option, the author is paid 12.5% of the net price of the novel for each copy of the novel sold. in the third option, the author is paid 10% of the net price for the first 4,000 copies sold, and 14% of the net price for the copies sold over 4,000. the author has some idea about the number of copies that will be sold and would like to have an estimate of the royal- ties generated under each option. write a program that prompts the author to enter the net price of each copy of the novel and the estimated number of copies that will be sold. the program then outputs he royalties under each option and the best option the author could choose. (use appropriate named constants to store the special values such as royalty rates and fixed royalties.
Answers: 1
You know the right answer?
This project is adapted from Programming project 5 on Page 520 of the textbook. We practice working...
Questions
question
Mathematics, 27.08.2021 05:20
question
Mathematics, 27.08.2021 05:20
question
Mathematics, 27.08.2021 05:20
question
History, 27.08.2021 05:20
Questions on the website: 13722360