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 01:30
Standardization is associated with which of the following management orientations? a) ethnocentric orientation b) polycentric orientation c) regiocentric orientation d) geocentric orientation
Answers: 1
question
Business, 22.06.2019 02:10
Materials purchases (on credit). direct materials used in production. direct labor paid and assigned to work in process inventory. indirect labor paid and assigned to factory overhead. overhead costs applied to work in process inventory. actual overhead costs incurred, including indirect materials. (factory rent and utilities are paid in cash.) transfer of jobs 306 and 307 to finished goods inventory. cost of goods sold for job 306. revenue from the sale of job 306. assignment of any underapplied or overapplied overhead to the cost of goods sold account. (the amount is not material.) 2. prepare journal entries for the month of april to record the above transactions.
Answers: 1
question
Business, 22.06.2019 04:30
Required prepare the necessary adjusting entries in the general journal as of december 31, assuming the following: on september 1, the company entered into a prepaid equipment maintenance contract. birch company paid $3,400 to cover maintenance service for six months, beginning september 1. the payment was debited to prepaid maintenance. supplies on hand at december 31 are $3,900. unearned commission fees at december 31 are $7,000. commission fees earned but not yet billed at december 31 are $3,500. (note: debit fees receivable.) birch company's lease calls for rent of $1,600 per month payable on the first of each month, plus an annual amount equal to 1% of annual commissions earned. this additional rent is payable on january 10 of the following year. (note: be sure to use the adjusted amount of commissions earned in computing the additional rent.)
Answers: 1
question
Business, 22.06.2019 15:30
Brenda wants a new car that will be dependable transportation and look good. she wants to satisfy both functional and psychological needs. true or false
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, 12.01.2021 03:30
question
Mathematics, 12.01.2021 03:30
question
Mathematics, 12.01.2021 03:30
question
Chemistry, 12.01.2021 03:30
Questions on the website: 13722361