Where it gets cut off FLUE EPIDEMIC PREDICTIONS BASED ON ELA
Where it gets cut off***
FLUE EPIDEMIC PREDICTIONS BASED ON ELAPSED DAYS SINCE FIRST CASE REPORT
Enter day number>> 7
by day 7, model predicts 5 cases total.
Enter day number>>10
by day 10, model predicts 11 cases total
enter day number>> 20
by day 20, model predicts 138 cases total
(using printf and scan f statements along with the normal #include math.h and stdio.h and such) for example it would be
printf(\"Enter day number >> \");
scanf(\"%d\", &day);
printf(\"By day %d, model preducts %d cases total\", day, cases);
An epidemic of a new strain of flu (i.e., one for which a vaccine is not available) begins with a single case on a college campus of 40,000 faculty, staff, and students. Three days later a second case is reported, and in the following days the reported cases are as shown in the table below The day of the initial case report is noted as day 0 Day # 035678910 11 Total cases 12 3 45 791115 A math professor observes that the number of cases seems to be increasing by about 28% per day and proposes the following model to predict the total number of cases by day number x: 40000 1+39999(e06i) Cases(x) = 0.2468 Write a function that implements diis model. Test your function with a main function that prompts die user diree times to enter a day number and dien calculates and displays the number of cases predicted for each day number entered Sample run FLU EPIDEMIC PREDICTIONS BASED ON ELAPSED DAYS SINCE FIRST CASE REPORTEnteSolution
#include <stdio.h>
#include <math.h> //importing to use exp function
//declaring prototype of the function
int cases(int x);
//main method
int main(){
//declaring variables for day and number of cases
int day;
int numOfCases;
//taking input number of days from the user
printf(\"Enter day number >> \");
scanf(\"%d\", &day);
//calling the function cases
numOfCases = cases(day);
//printing out the value of number of cases returned using the cases(day) function
printf(\"By day %d, model preducts %d cases total.\ \", day, numOfCases);
}
//cases function
int cases(int x){
//return the number of days in integer
return 40000.0/(1.0+39999.0*(exp(-0.24681*x)));
}

