Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

undefined Project 1: CoVID-19 Spread and Prevention Simulator Posted: Tuesday February 9, 2021 Due: 11:59 PM, Monday, February 15, 2021 (phase I only) 11:59PM, Monday,

undefinedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Project 1: CoVID-19 Spread and Prevention Simulator Posted: Tuesday February 9, 2021 Due: 11:59 PM, Monday, February 15, 2021 (phase I only) 11:59PM, Monday, March 1, 2021 (final complete project) Project Objective: Review programming skills in C under GLUE UNIX that includes: 1. file operations in C 2. command-line arguments in C 3. arrays, conditional statements, and loops 4. basic data processing techniques and problem solving skills Project Description Through the course of this assignment, you will develop a program that simulates the spread of COVID-19 and the effectiveness of prevention mechanisms. The project consists of two phases. In Phase I, you need to define a structure for the project and implement one function that will be useful for the project. After Phase I is due, the complete projection description will be posted with a suggested structure and the features that are required to be implemented for Phase II. Consider a closed community with a population of n people, out of which some have tested positive for COVID. Each day, a person may interact with some random number of people randomly from the population. If a healthy person interacts with one who has tested positive, the healthy person will get infected with a certain probability. If that happens, on the second day, the infected person will be considered as tested positive and may infect others whom he/she interacts with. After 14 days, the infected person will be fully recovered. There are several CoVID prevention mechanisms, (1) face mask: wearing face mask will reduce the probability that a healthy person being infected and the probability that a test positive person infecting others; (2) COVID vaccine: a person who is vaccinated will have a much lower probability of being infected; (3) quarantine: if a person who is tested positive is quarantined, he/she will not interact with anyone until he/she becomes healthy again and thus will not infect anybody). Phase I questions: 1. Define a structure that captures all the features we have mentioned above. Note that in Phase II, we will announce a suggested structure, you can use either yours or the suggested one. 2. Implement a function that choose k distinct numbers randomly from 0, 1, 2, ..., n-1 (k #include #include time, h> typede struct person in ID: int maski 1/0: not wear face mask; 1: wear face maski int vaccines 1/0: not vaccinated; 1: vaccinated; 1/0: healthyil: infected: 2: recovered; 3: quarantined int days infected 17 will recover after 14 daya int daya tarantined 1/ quarantine will be over after 14 days #define POPULATION 50000 // define global variables // define function prototypes with documentation void Initialization (...); // document this function void Simulation (...); // document this function int main(int argc, char * argv[]) { // declare variables that you need to keep information; // use comments to document these variables int days = 0; // number of days to run the simulation, provided // by the user from command line (as number of weeks) float p infection; 1/ probability of getting infected without protection FILE IN OUT; int i, j, k; // FILE pointers for the two files // temporary variables such as loop variables Person A[POPULATION]; // an array of people for the population // check command line argument and input/output files, terminate on error; // getting values of the parameters from the command line and input file; days = 7*atoi (argv[1]); // value from the command line fscanf(IN, "%f", &p_infection); // value from input file Initialization (OUT, A,p_infection, ...); // add other necessary parameters for the function call // initialize the population based on the obtained value // these information will be printed to the output file for (i=0; i<>

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

Recommended Textbook for

Upgrading Oracle Databases Oracle Database New Features

Authors: Charles Kim, Gary Gordhamer, Sean Scott

1st Edition

B0BL12WFP6, 979-8359657501

More Books

Students also viewed these Databases questions

Question

3 The makeup of the Federal Reserve and the U.S. banking system.

Answered: 1 week ago

Question

How do Excel Pivot Tables handle data from non OLAP databases?

Answered: 1 week ago