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:30
Dr. dow jones wants to know whether a problem-based approach to teaching economics will result in higher academic performance than his traditional method. of the six sections of economics 101 at his university, dr. jones randomly assigns three sections to the traditional method and three sections to the problem-based method for unit 1 of the course. then all sections switch the instructional method for unit 2. he plans to compare the performance of the two groups of sections on their unit 1 and unit 2 exams. this study employs a design.
Answers: 3
question
Business, 22.06.2019 20:20
As you have noticed, the demand for flip phones has drastically reduced, and there are only a few consumer electronics companies selling them at extremely low prices. also, the current buyers of flip phones are mainly categorized under laggards. which of the following stages of the industry life cycle is the flip phone industry in currently? a. growth stage b. maturity stage c. decline stage d. commercialization stage
Answers: 2
question
Business, 22.06.2019 21:20
Which of the following best explains why large companies pay less for goods from wholesalers? a. large companies are able to pay for the goods they purchase in cash. b. large companies are able to increase the efficiency of wholesale production. c. large companies can buy all or most of a wholesaler's stock. d. large companies have better-paid employees who are better negotiators.
Answers: 2
question
Business, 22.06.2019 22:00
Acompany's sales in year 1 were $300,000, year 2 were $351,000, and year 3 were $400,000. using year 2 as a base year, the sales percent for year 3 is
Answers: 2
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, 30.10.2020 01:00
question
Mathematics, 30.10.2020 01:00
question
Mathematics, 30.10.2020 01:00
question
Mathematics, 30.10.2020 01:00
question
Mathematics, 30.10.2020 01:00
Questions on the website: 13722361