Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please help ASAP I just need the dummy return statements fixed. this is a working code. please read the // lines ... please help! please

please help ASAP I just need the dummy return statements fixed. this is a working code. please read the // lines ... please help!

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

please help asap

1: Unit test 0/2 Testing avgDaysin Hospital 15.8571 O Test feedback 15.8571 avgDays InHospital() incorrectly returned 0 0/2 2. Unit test Testing percentageHospitalized() 0.714286 Test feedback 0.714286 percentageHospitalized incorrectly returned 0 02 3: Unit test A Testing percentageAge Hospitalized() 0.75 Test feedback 0.75 percentageAgeHospitalized () incorrectly returned 0 0/2 4 Unit testa Testing index MostDays) Test feedback indexMost Days ( incorrectly returned 0 66 0 Karen Mary McIntyre Leonardo Sam Gibson Kaylan Camille Keller Carson Nolan Han Bernard Jack Hart 13529318 87929139 45893209 88792390 98234925 01 65 0 9. Cough, Diff. Breathing, Eatigue, Stuffy or Runn Fever, Cough, Diff. Breathing, Fatigue, Muscle Headache, New Loss Taste or Smell, Sore Throat, Fatigue, Muscle or Body Aches, Sore Throat, Stu: Fever, Diff. Breathing, Fatigue, Muscle or Body 69 98 20 James Ray Wood - 70934578, age 85, required the longest hospitalization of 29 days. Average days in hospital for all patients: 0.00 The percentage of patients requiring hospitalization: 0.00% Age Percentage Range Hospitalized 0 - 4 5- 17 18 - 49 50 - 64 65 - 74 75 - 84 >= 85 0.00% 0.00% 0.008 0.00% 0.00% Number of Symptoms Patient Name Age 85 0 19 0 0 0 James Ray Wood Sophia Helen Clarke J'Layne Blair Harris Wade Brent Hughes Zoe Ann Wright Landon Matthew Lee Janice Joy Rodriquez Jennifer Kay Jones Sharon Renee Nguyen Werner Allen Garcia 85 55 22 35 0 0 90 0 0 64 0 69 85 0 119 120 121 / 122 The percentageHospitalized() function accepts as arguments the array that holds the number of days in the 123 hospital and the number of patients. The function uses a loop to traverse through the days array and if 124 a patient spent time in the hospital (if number of days is > ), then a counter is incremented. When 125 the loop terminates, the counter holds the number of people who were hospitalized. The percentage is 126 computed by dividing the counter by the number of patients. The function returns this percentage in 127 decimal format (i.e. - the value is not multiplied by 100). 128 */ 129 double percentageHospitalized(int days[], int numPatients) 130 131 return 8; // dummy return statement 132 ) 133 134 135 The percentageAge Hospitalized function accepts as arguments the days array, age array, number of patients, 136 and a lower and upper age range. This function uses a loop to traverse through the days array and keeps 137 count of the number of people in the given age range (i.e. age >= lower and age = 85" > patientID[i] >> age[i] >> days InHospital[i]; 38 for (int j = 0; j > patientsymptoms[i][j]); can ignore(); 24 25 11 Output the header of the table followed by a row of dashes cout 2 #include 3 #include 4 #include 5 6 using namespace std; 7 8 / Constants */ 9 const int NUM_PATIENTS = 34; // Constant used to define the parallel arrays sizes 10 const int NUM_SYMPTOMS = 11; 11 12 /* Function prototypes */ 13 int indexMostDays (int[], int); 14 double avgDays InHospital(int[], int); 15 double percentageHospitalized(int[], int); 16 double percentageAgeHospitalized (int[], int[], int, int, int); 17 int numberOfSymptoms (int, bool patientsymptoms[][NUM_SYMPTOMS]); 18 19 20 int main() 21 [ 22 string name [NUM_PATIENTS]; //Holds the name for each patient 23 int patientID[NUM_PATIENTS]; //Holds the ID for each patient 24 int age [NUM_PATIENTS]; // Holds the age of each patient 25 int daysInHospital[NUM_PATIENTS]; // Holds the number of days each patient spent in the hospital 26 string symptom[NUM_SYMPTOMS] - ("Fever", "Cough", "Diff. Breathing", "Fatigue", "Muscle or Body Aches", "Headache", "New Loss Taste or Sm 27 bool patientsymptoms [NUM_PATIENTS] [NUML_SYMPTOMS ); 28 29 /* Populate all arrays reading from standard input. The data is expected to be 30 in the following format for each patient: 31 Patient Name (string) 32 Patient ID(int) age(int) days (int) 33 34 for (int i = 0; i > patientID[i] >> age[i] >> daysInHospital[i]; 38 for (int j = 0; j > patientsymptoms[i][j]; 41 } 42 cin.ignore(); 43 } 44 45 1/ Output the header of the table followed by a row of dashes 46 cout

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

Mastering Big Data Interview 751 Comprehensive Questions And Expert Answers

Authors: Mr Bhanu Pratap Mahato

1st Edition

B0CLNT3NVD, 979-8865047216

Students also viewed these Databases questions

Question

Explain the guideline for job description.

Answered: 1 week ago

Question

What is job description ? State the uses of job description.

Answered: 1 week ago

Question

What are the objectives of job evaluation ?

Answered: 1 week ago

Question

Write a note on job design.

Answered: 1 week ago

Question

4. Devise an interview strategy from the interviewers point of view

Answered: 1 week ago