You are tasked with writing a complete C program that provides the functionality described below:
"You own a set of flats and need to collect the rent from your student tenants; their contract says they need to pay rent on the first day of each month, but there is a grace period of x days which is the last digit of your student ID number (read in as a single input by your program). If the rent is paid in one of the days in the range 1 - x (inclusive), then your program displays a Thank you message. Otherwise, your program charges the tenant a late fee that is either 5% of the rent or £30.00 (whichever is greater); it displays a 'late fee' message notifying the tenant accordingly."
If the last digit of your student ID is less than 3, then the program should set the grace period x to be value 5. You should assume that the rent amount is represented by a double value.
Below is an example of running the program with specific input values:
Enter date paid, rent value, last digit of ID: 6 400.00 4
Rent was due by day 4 of the month; your late fee is = 30.00 pounds
The program must not use in-built C functions; the exception to this are scanf() and printf().
All conditions in the code must use a conditional operator.
The program’s variables must be sensibly named.
The code must include comments that are meaningful, short and clear, to explain all major parts of the program.