Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Explain the nature of human resource management.

Answered: 1 week ago

Question

Write a note on Quality circles.

Answered: 1 week ago

Question

Describe how to measure the quality of work life.

Answered: 1 week ago