#include #include void current(); void print_menu(); int main() { int choice; do { print_menu(); scanf("%d", &choice); switch (choice) { case 1: current(); break; case 2: printf("Exiting...\n"); break; default: printf("Invalid choice. Please try again.\n"); } } while (choice != 2); return 0; } void print_menu() { printf("Choose:\n"); printf("1. Get the output and percentage\n"); printf("2. Exit the program\n"); printf("Enter your choice: "); } void current() { int days; float infected = 7.0; float infected_today = 7.0; int withdraw; const int total = 2440; const float fee = 9972.0; printf("Enter days: "); scanf("%d", &days); if (days <= 0) { printf("Invalid number of days. Please enter a positive number.\n"); return; } for (int i = 0; i < days && infected <= total; i++) { infected += infected_today * 0.2; infected_today *= 1.2; if (i < 14) { withdraw = (int)infected; } } if (infected > total) { infected = total; } int total_rounded = (int)infected; float percentage = (infected / total) * 100; float not_infected = total - withdraw; float discount = not_infected * (fee * 0.05); float loses = withdraw * fee + discount; printf("The number of infected students is: %d, a percentage of %.2f, the total losses are $%.0f corresponding to %d students, the number of students receiving a 5 percent discount is %.0f, and the total amount given in discounts is $%.0f\n", total_rounded, percentage, loses, withdraw, not_infected, discount); }