Question
C PROGRAMMING: An epidemic of a new strain of flu begins with a single case on a college campus. Three days after the first case,
C PROGRAMMING: An epidemic of a new strain of flu begins with a single case on a college campus. Three days after the first case, another case is discovered. In the following days, the number of cases grows rapidly. A professor on campus fits the data to the following model and proposes its use to predict the number of cases as the epidemic progresses.
Cases = 40,000 / (1+39,999 e ^(-0.24681*t)) , where t is the number of days after the first case is discovered.
Write a program that accepts the number of days as an input and displays the projected number of flu cases.
Your program needs to include a custom call-by-value function named epidemic_model, which accepts the number of days as an integer input argument and returns an integer value equal to the number of predicted cases.
ALL printf and scanf statements should be in the main function, and ALL calculations should be in the custom function epidemic_model.
Your program should display the result as follows:
Enter number of days: 10 By day 10, model predicts 11 cases total.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started