Question: C PROGRAMMING: Repeat the previous lab, but this time use a call-by-reference function. An epidemic of a new strain of flu begins with a single

C PROGRAMMING: Repeat the previous lab, but this time use a call-by-reference function.

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-reference function named epidemic_model2, with two input arguments and no return. The first input argument is an integer with the number of days, and the second input argument is a pointer to output the number of cases predicted.

ALL printf and scanf statements should be in the main function, and ALL calculations should be in the custom function epidemic_model2.

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

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!