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 09:30
Stock market crashes happen when the value of most of the stocks in the stock market increase at the same time. question 10 options: true false
Answers: 1
question
Business, 22.06.2019 18:50
)a business incurs the following costs per unit: labor $125/unit, materials $45/unit, and rent $250,000/month. if the firm produces 1,000,000 units a month, calculate the following: a. total variable costs b. total fixed costs c. total costs
Answers: 1
question
Business, 22.06.2019 19:40
Banana computers has decided to procure processing chips required for its laptops from external suppliers instead of manufacturing them in their own facilities. how will this decision affect the firm? a. the firm will be protected against the principal-agent problem. b. the firm's administrative costs will be low because of necessary bureaucracy. c. the firm will have more flexibility in purchasing and comparing prices of goods and services. d. the firm will have high-powered incentives, such as hourly wages and salaries.
Answers: 3
question
Business, 22.06.2019 20:00
A$100 million interest rate swap has a remaining life of 10 months. under the terms of the swap, the six-month libor is exchanged semi-annually for 12% per annum. the six-month libor rate in swaps of all maturities is currently 10% per annum with continuous compounding. the six-month libor rate was 9.6% per annum two months ago. what is the current value of the swap to the party paying floating? what is its value to the party paying fixed?
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, 18.03.2021 03:20
question
Physics, 18.03.2021 03:20
question
Mathematics, 18.03.2021 03:20
question
Mathematics, 18.03.2021 03:20
question
Mathematics, 18.03.2021 03:20
question
Mathematics, 18.03.2021 03:20