Question: C code program that calculates late fees for a library. Late fees for students is .85 cents a day, adults 1.20- with maxmimum allowed fees

C code program that calculates late fees for a library. Late fees for students is .85 cents a day, adults 1.20- with maxmimum allowed fees of $22.00 for students and 27.00 for adults. Use 2 symbolic constants, one for the month set to April (as 3) and the current day (as 30). Ask for the person's name in main(). Use the function void showFees() which has no parameters and returns nothing to display the late fees for the students and adults. In main() ask the user to enter the month and day the late book was due. Send the inputted month and day to the function

validateDate()- if the entered month and day are invalid, continue to prompt until a valid month and day are entered. After validation of the date, display the date as MM/DD format.

Also from main(), create a menu of 1-student and 2-adult. Use the switch statement to determine the late fee they will be paying. If an invalid choice is entered, display ERROR message and automatically set the fee to adult. Use a function calcFees() which receives the number of days the book is overdue, and the late fee and totals the final late fee bill. Send this calculation back to main, where it is printed. Finally, loop to ask if there is another person to calculate late fees for.

This is what I have so far:

#include #include #define MAY 5 #define DAY 3 validateDate();

void showFees();

calcFees();

int main()

{

float lateFee;

char name;

showFees();

validateDate();

int customerType;

printf("Welcome to the Library late fee system");

printf("What is your name?");

scanf("%c", &name);

printf("Enter 1 for student or 2 for adult");

scanf("%d", &customerType);

switch(customerType)

case 1:

lateFee = .85;

break;

case 2:

lateFee = 1.20

break;

default:

printf("Error")

lateFee = 1.20

}

validateDate()

void showFees()

{

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!