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, 22.06.2019 03:50
John is a 45-year-old manager who enjoys playing basketball in his spare time with his teenage sons and their friends. at work he finds that he is better able to solve problems that come up because of his many years of experience, but while on the court, he finds he is not as good keeping track of the ball while worrying about the other players. john's experience is:
Answers: 1
question
Business, 22.06.2019 14:00
The following costs were incurred in may: direct materials $ 44,800 direct labor $ 29,000 manufacturing overhead $ 29,300 selling expenses $ 26,800 administrative expenses $ 37,100 conversion costs during the month totaled:
Answers: 2
question
Business, 22.06.2019 20:00
Ryngard corp's sales last year were $38,000, and its total assets were $16,000. what was its total assets turnover ratio (tato)? a. 2.04b. 2.14c. 2.26d. 2.38e. 2.49
Answers: 1
question
Business, 23.06.2019 00:30
An emerging methodology to integrate the effort of the development team and the operations team to improve the functionality and security of applications is known as
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
Questions on the website: 13722367