subject
Business, 19.11.2019 00:31 125712

Program in cwrite a program that a daycare center manage their waiting list. the program stores requests for being added to the waiting list. each request was stored with the classroom, the child’s first name, last name, and contact phone number. the provided program waiting_list. c contains the struct request declaration, function prototypes, and the main function. complete the function definitions so it uses a dynamically allocated linked list to store the waiting list requests. complete the following functions: 1. append_to_list: a. ask the user to enter the classroom, child’s first name, and last name. b. check whether a request has already existed by classroom and the child’s first name and last name. if a request has the same classroom, first name and last name as an existing request in the list, the function should print a message about using the update function to update classroom and exit. c. if the request does not exist, ask the user to enter the contact phone number. d. allocate memory for the structure, store the data, and append it to (add to the end of) the linked list. e. if the list is empty, the function should return the pointer to the newly created linked list. otherwise, add the request to the end of the linked list and return the pointer to the linked list.2. update: update a request’s classroom. when a child is on the waiting list for a long period of time, he/she might need to be moved to the waiting list for another classroom. in this function, ask the user to enter the classroom, child’s first name, and last name. find the matching child, ask the user to enter the new classroom and update the classroom. if the child is not found, print a message.3. printlist: print the classroom, child’s first and last name, and contact phone number of all requests in the list.4. clearlist: when the user exists the program, all the memory allocated for the linked list should be deallocated. note: use read_line function included in the program for reading first name, last name, classroom, and phone number. waiting_list. c#include #include #include #include #define room_len 100#define name_len 30#define phone_len 15struct request{ char classroom[room_len]; char first[name_len+1]; char last[name_len+1]; char phone[phone_len+1]; ; struct request *next; }; struct request *append_to_list(struct request *list); void update(struct request *list); void printlist(struct request *list); void clearlist(struct request *list); int read_line(char str[], int n); / main: prompts the user to enter an operation code, ** then calls a function to perform the requested ** action. repeats until the user enters the ** command 'q'. prints an error message if the user ** enters an illegal code. /int main(void){char code; struct request *wait_list = null; printf("operation code: a for appending to the list, u for updating a book" ", p for printing the list; q for quit.\n"); for (; ; ) {printf("enter operation code: "); scanf(" %c", & code); while (getchar() ! = '\n') /* skips to end of line */; switch (code) {case 'a': wait_list = append_to_list(wait_list); break; case 'u': update(wait_list); break; case 'p': printlist(wait_list); break; case 'q': clearlist(wait_list); return 0; default: printf("illegal code\n"); }printf("\n"); }}struct request *append_to_list(struct request *list){//add your codereturn null; }void update(struct request *list){//add your code}void printlist(struct request *list){//add your code}void clearlist(struct request *list){//add your code}int read_line(char str[], int n){int ch, i = 0; while (isspace(ch = ; str[i++] = ch; while ((ch = ! = '\n') {if (i < n)str[i++] = ch; }str[i] = '\0'; return i; }

ansver
Answers: 2

Another question on Business

question
Business, 21.06.2019 21:00
Intronix uses copy editors, computer graphics specialists, and java programmers to produce ads for magazines and the internet. the average new ad for magazines typically requires 180 hours of a copy editor's time and 135 hours of a computer graphics specialist's time, whereas ads produced for the internet require 35 hours of copy editor time, 195 hours of computer graphics time, and 60 hours of a java programmer's time. lassie food, a dog food manufacturer, has hired intronix to produce ads in the next four week. although currently it considers magazine ads 3 times more valuable than internet ads, it still wishes to have at least 2 of each produced within the next four weeks. intronix has assigned up to 3 copy editors, 4 computer graphics specialists, and 1 java programmer, each committed to work up to 70 hours per week on the project. how many of each type of ad should be produced to maximize the overall value to lassie foods
Answers: 3
question
Business, 22.06.2019 08:00
In addition to using the icons to adjust page margins, a user can also use
Answers: 1
question
Business, 22.06.2019 10:20
Asmartphone manufacturing company uses social media to achieve different business objectives. match each social media activity of the company to the objective it the company achieve.
Answers: 1
question
Business, 22.06.2019 12:00
Describe the three different ways the argument section of a cover letter can be formatted
Answers: 1
You know the right answer?
Program in cwrite a program that a daycare center manage their waiting list. the program stores req...
Questions
question
Mathematics, 02.04.2020 16:43
Questions on the website: 13722361