Question: Question: Write a C code for a veterinary clinic that stores information about various animals. Your program should calculate the total time the animal stays

Question: Write a C code for a veterinary clinic that stores information about various animals. Your program should calculate the total time the animal stays in the clinic in minutes and outputs the price of the animal care service. In this lab exam, you are required to write a main function that takes information about animal id, check-in, and check-out time as hours and minutes from the user. After that, the main function should call the "hours_to_minutes" function to find the total time of stay in minutes considering the check-in and check-out times. Assume that check-in time should be earlier than check-out time. You need to calculate and output the animal care price in the main function. For calculation of animal care service price, you should consider the following price information: If the animal stays in the clinic less than or equal to 75 minutes, cach minute cost 0.75 cents. If the animal stays in the clinic for more than 75 minutes, each minute cost 0.60 cents. Then ask user if he/she wants to continue or not. Your program will terminate when 'n' is entered (Hint: Use a loop for continuous asking). Write a function named "hours_to_minutes". This function should receive hours and minutes from the main function as parameters. Then, calculates total time in minutes and returns the total time to the main function. (Exp. If this function receives 10 for hours as the first parameter and 45 for minutes as the second parameter, it will return 645 as total time in minutes) Please check Sample Run() below. Sample Run-1: Enter animal ID:123 Enter check-in time as hours and minutes (hh mm): 10 45 Enter check-out time as hours and minutes (hh mm):12 33 Animal ID:123 stayed in the clinic for 108 minutes and the care price is:64.805 Do you want to continue (y)?:y Enter animal ID:456 Enter check-in time as hours and minutes (hh mm):14 45 Enter check-out time as hours and minutes (hh mm):15 35 Animal ID:456 stayed in the clinic for 50 minutes and the care price is:37.50$ po you want to continue (y)?:n Sample Run-2: Enter animal ID:6789 Enter check-in time as hours and minutes (hh mm):14 05 Enter check-out time as hours and minutes (hh mm):15 00 Animal ID:6789 stayed in the clinic for 55 minutes and the care price is:41.25$ Do you want to continue (y)?:y Enter animal ID: 12345 Enter check-in time as hours and minutes (hh mm):1 50 Enter check-out time as hours and minutes (hh mm):3 25 Animal ID:12345 stayed in the clinic for 95 minutes and the care price is:57.00$ Do you want to continue (y)?:y Enter animal ID:3456 Enter check-in time as hours and minutes (hh mm):20 30 Enter check out time as hours and minutes (hh mm):23 52 Animal ID:3456 stayed in the clinic for 202 minutes and the care price is: 121.20$ Do you want to continue (y)?:n
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
