Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE HELP ME FIGURE OUT THIS CODE! I need the percentage hospitalized fixed and the number of symptoms! please help ASAP! these next ones are

PLEASE HELP ME FIGURE OUT THIS CODE! I need the percentage hospitalized fixed and the number of symptoms! please help ASAP!

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

these next ones are what my codes output

image text in transcribed

image text in transcribed

next I will take a picture of my code all I need is to be told how to fix you do not have to write the emote code out for me. thank you for your time.

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

Figure 1: (sample input) James Ray Wood 70934578 9529 1 oliooooo Sophia Helen Clarke 10342916 19 0 ololo ololo o J'Layne Blair Harris 61324590 85 27 0 1 0 0 0 0 1 0 0 0 0 Wade Brent Hughes 39543993 55 10 1 1 1 1 1 1 0 0 0 0 0 Zoe Ann Wright 23004547 222 1 0 1 0 0 0 0 0 0 0 0 Landon Matthew Lee 19283421 35 0 0 0 0 0 0 0 0 0 0 0 0 Janice Joy Rodriquez 13829931 90 19 1 1 0 1 0 1 0 1 0 1 1 Jennifer Kay Jones 2349129364 0 0 0 0 0 0 0 0 0 1 1 Sharon Renee Nguyen 32199181 69 5 1 0 0 1 1 0 0 0 0 0 0 Werner Allen Garcia 12398441 85 20 1 1 0 1 1 1 1 0 0 0 0 Luis William Guerra 4012844100 0 0 0 0 0 1 1 0 0 0 0 Samuel Pate Parks 31239321 20 0 1 0 0 0 1 1 0 0 0 0 Sarah Faye Parks 31239322 21 Sarah Faye Park 31239322 21 1 1 1 0 0 0 0 0 0 0 Kimberly Ann Jarvis 3123932110 1 0 0 0 0 0 0 0 0 0 0 Claire Lou Chapman 31239321 5 0 1 1 1 1 0 0 0 0 0 0 0 Jimmy John Parker 013252959 12 0 0 0 0 0 0 0 1 0 0 0 0 Ella Marie Feinstein 91382933 90 35 1 1 0 1 0 0 1 1 0 0 0 Amelia Ann Napa 023193199 77 5 1 0 1 0 0 0 0 0 1 1 1 Moll: Mae Minzenmeyer 32913944 19 0 1 1 0 0 0 1 0 1 1 0 0 Joe Allen Sanchez 32903999 29 0 0 0 0 0 0 0 0 0 0 1 1 Roxie Leona Regan 10392397 75 32 1 1 1 1 0 0 0 1 0 0 0 Richard Ray Alvarez 99314092 66 5 0 0 0 1 1 0 0 1 1 0 0 J'Ron Jason MacRue 61749283 54 0 0 0 1 1 0 1 1 0 0 0 0 Danielle Jess Millex 54928301 S 0 0 1 0 0 0 0 1 1 1 0 0 Darcy Shea Van Pelt 32952092 10 0 0 0 0 0 0 0 0 0 0 1 Brooklyn May Rosser 310327322 0 Brooklyn May Rosser 31032732 2 0 1 0 0 0 0 0 0 1 0 0 0 Cade Jose Ramirez 11323493 0 0 1 1 1 0 0 0 0 0 1 0 0 Isaiah John Smith 19334232 53 0 0 1 1 1 1 1 0 0 0 0 0 Leah Faye Elliott 031325331 19 0 1 1 1 0 0 0 0 0 0 0 0 Karen Mary McIntyre 13529318 66 0 0 1 1 1 0 0 0 0 1 0 0 Leonardo Sam Gibson 87929139 81 0 1 1 1 1 1 1 0 0 0 0 0 Kaylan Camille Keller 458.93 209 650 0 0 0 0 1 1 1 1 0 0 Carson Nolan Han 887 923 90 69 9 0 0 0 1 0 0 1 1 1 1 Bernard Jack Hart 9823 4925 88 20 1 0 1 1 1 0 0 0 0 0 0 Figure 2: (sample output) - If the output is wrapping, widen your screen. Days In Hospital Fatient Name Patient ID Age Symptoms 29 0 James Ray Wood Sophia Belen Clarke Layne Blair Earris Rede Bzent Bughes 85 19 85 55 22 27 Fever, Cough, Diff. Breathing, Muscie or Body Aches, Headache Cough, Fatigue, New Loss Taste or Smeli, Stuffy or Runny Nose Cough, New Loss Taste or Sme 11 Fever, Cough, Diff. Breathing, Fatigue, Muscle or Body ches, Beadache Fever, Diff. Breathing 10 2 70934578 10342916 61324590 39543993 23004547 19283421 13629931 23491293 32199161 12398441 35 19 Landen Matthew Lee Janice Joy Rodrigues Jenna Fer Kay Jones Sharon Renee Nguyen Fever, Cough, Fatigue, Headache, Sore Throat, Nausea, Diarrhea Nausea, Diarrhea Fever, Fatigue, Muscle or Body Aches Fever, Cough, Fatigue, Muscie or Body Aches, Headache, New 1023 Taste 5 69 85 3 2. 2. 1 0 5 35 5 or Sme Los 11: Buerra Samuel Rate Perks Serah Feye Parks Kimberly Ann Jarvis Claire Lou Chapman Ommy John Parker Elle Marie Fernstein melie in Rape Molls Mae Manzemeyer Joe Allen Sanchez Roxie Leone Regen Richard Ray Alvarez Ron Jason MacRue Danielle Jess Miller Darcy Shes Van Pelt Brooklyn Mey Rosser Cade Jose Ramirez Isaiah John Smith Leah Faye Elliott Karen Mary McIntyre Leonardo San Gibson 40128441 31239521 31239322 31239321 31239321 13252959 91382933 23193199 32913944 31903999 10992397 99314092 61749283 54928301 32952092 81032732 11323493 19934282 51925881 13529318 87929199 A00 12 90 77 19 29 75 66 32 5 Headache, New Loss Taste or Sme11 Cough, Headache, New Loss Taste or Smel Cough, Diff. Breathing, Fatigue Fever Fever, Cough, Ditt. Breathing, Fatigue New Loss Taste or Smell Fever, Cough, Fatigue, New Loss Taste or Smell, Sore Throat Fever, Diff. Breathing, Stuffy or Runny Nose, Nausea, Diarrhea Fever, Cough, Headache, Sore Throat, Stuify or Runny Nose Nausea, Diarrhea Fever, Cough, Dife. Breathing, Fatigue, Sore Throat Fatigue, Muscle or Body Aches Sore Throat, Stuity or Runny Nose Diff. Breathing, Fatigue, Headache, New Loss Taste or Smell Cough, New Loss Taste Or Smelt. Sore Throat, Stuffy or Runny Nose Diarrhea Fever, Sore Throat Fever, Cough, Dift. Breathing Stuffy or Runny Nose Cough, Diff. Breathing, Facique Muscle or Body Ache, Headache Fever, Cough, Diff. Breathing Cough, Diff. Breaching, Wague Suriy o Runny Nose Fever, Cough, D. Breathing fatigue. Muscle on Body Aches, Headache 0 0 1 0 0 2 0 58 19 66 ei 0 INSA Leonardo Sam Gibson Kaylan Camille Keller Carson Nolan Han Nausea, Diarrhea Bernard Jack Hart 87929139 45893209 88792390 81 65 69 0 0 Fever, cough, Diff. Breathing, Fatigue, Muscle or Body Aches, Headache Headache, New Loss Taste or Smeli, Sore Throat, Stucky or Runny Nose Fatigue, Muscle or Body Acheg, Sore Throat, Sturdy Or Runny Nose, 9 98234925 88 20 Fever, Diff. Breathing, Fatigue, Muscle or Body Aches Ella Marie Feinstein - 91382933, age 90, required the longest hospitalization of 35 days. Average days in hospital for all patients: 6.44 The percentage of patients requiring hospitalization: 41.187 Percentage Range Hospitalized 5 - 12 15 - 49 12.505 0.003 16.67% 25.00% 60.00% 66.67% 100.000 65-74 75 - 84 = 65 Number of Symptoms Patient Name Age 5 4 2 19 85 55 22 35 6 2 0 7 64 2 James Bay Wood Sophie Eeler Clarice Jayne Blair Ferris Wade Brent Bughes Zoe Eers fragt Landon Matthew Lee Janice Joy Roorsquez Jennifer Ray Jones Sharon Renee Nguyen Werner Allen Garcia Duis William Guerra Samuel Pate Parke Sarah Faye Parks Kimberly Penn Jarvis Claire Lou Chapman Jimmy John Parker ELLE Marie Feinstein 3 6 85 2 2 2 1 5 12 3 3 1 4 1 5 Number Symptome Patient Name Age 4 85 19 85 55 2 2 35 7 2 64 69 85 3 6 0 2 3 2 2 1 5 12 James Ray Wood Sophia Helen Clarke Jayne Blair Harris Wade Brent Hughes Zoe Ann Wright Landon Matthew Lee Janice Joy Rodriquez Jennifer Kay Jones Sharon Renee Nguyen Werner Allen Garcia Luis William Guerra Samuel Pate Parks Sarah Faye Parks Kimberly Ann Jarvis Claire Lou Chapman Jimmy John Parker Ella Marie Feinstein Amelia Ann Napa Moll: Mae Minzenmeyer Joe Allen Sanchez Roxie Leona Regan Richard Ray Alvarez J'Ron Jason MacRue Danielle Jess Maller Dercy Shes Van Pelo Brooklyn May Rosser Cade Jose Ramirez Isaiah John Smith Leah Faye Elliott Karen Mary McIntyre Leonardo Sam Gibson Kaylan Camille Keller Carson Nolan Han Bernard Jack Hart 5 90 77 19 29 17.5 66 54 5 19 4 3 4 1 2 2 O 513 19 66 81 65 69 88 2 4 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 5 - 17 18 - 49 50 - 64 65 - 74 75 - 84 >= 85 0.00% 0.00% 0.00% 0.00$ 0.00% 0.008 Number of Patient Name Age Symptoms 85 0 19 0 85 55 0 0 0 James Ray Wood Sophia Helen Clarke Layne Blair Harris Wade Brent Hughes Zoe inn Wright Landon Matthew Lee Janice Joy Rodriquez Jennifer Kay Jones Sharon Renee Nguyen Werner Allen Garcia Luis William Guerra Samuel Pate Parks Sarah Faye Parks Kimberly Ann Jarvis claire Lou Chapman 22 35 90 64 0 0 69 85 0 0 0 in N No 0 1 0 0 90 0 0 0 69 85 0 0 2 0 2 0 0 1 5 0 12 0 90 77 0 0 Janice Joy Rodriquez Jennifer Kay Jones Sharon Renee Nguyen Werner Allen Garcia Luis William Guerra Samuel Pate Parks Sarah Faye parks Kimberly Ann Jarvis Claire Lou Chapman Jimmy John Parker Ella Marie Feinstein Amelia Ann Napa Molli Mae Minzenmeyer Joe Allen Sanchez Roxie Leona Regan Richard Ray Alvarez J'Ron Jason MacRue Danielle Jess Miller Darcy Shea Van Pelt Brooklyn May Rosser Cade Jose Ramirez Isaiah John Smith Leah Faye Elliott Karen Mary McIntyre Leonardo Sam Gibson Kaylan Camille Keller Carson Nolan Han Bernard Jack Hart 19 29 75 0 0 66 54 0 3 0 0 2 0 53 0 O 19 66 65 69 o e o 0 88 1 #include 2 #include 3 Sinclude 4 include 5 6 using namespace std; 8 /* Constants 9 const int NUM_PATIENTS = 34; 77 Constant used to define the parallel arrays sizes se const int NUM_SYMPTOMS = 11; 11 12 r Function prototypes */ 13 int indexMostDays (int[], int); 14 double avgDaysInHospital(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() string name [NUM_PATIENTS]; //Holds the name for each patient ant patient IDINUM_PATIENTS]; /Holds the ID for each patient int age[NUM_PATIENTS); 17 Holds the age of each patient int daysInHospital [NUM_PATIENTS); 1/ Holds the number of days each patient spent in the hospital string symptom[NUM_SYMPTOMS] = {"Fever", "Cough", "Diff. Breathing", "Fatigue", "Muscle or Body Aches", "Headache", "New Loss Taste or Sim bool patientsymptoms [NUM_PATIENTS] [NUM_SYMPTOMS); 26 /* Populate all arrays reading from standard input. The data is expected to be in the following format for each patient: Patient Name(string) Patient ID(int) age(int) days (int) for (int i = 0; i > patient ID[i] >> age[i] >> days InHospital[i]; for (int j = 0; j > patientsymptoms[i][j]; cin.ignore(); 45 46 47 48 49 5e 51 1 Output the header of the table followed by a row of dashes cout - 85" e), 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 1 131 return @; 11 dummy return statement 132 ] 133 134 135 The percentage gehospitalized() 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 0.00% 0.00% 0.00% 0.00$ 0.00% 0.008 Number of Patient Name Age Symptoms 85 0 19 0 85 55 0 0 0 James Ray Wood Sophia Helen Clarke Layne Blair Harris Wade Brent Hughes Zoe inn Wright Landon Matthew Lee Janice Joy Rodriquez Jennifer Kay Jones Sharon Renee Nguyen Werner Allen Garcia Luis William Guerra Samuel Pate Parks Sarah Faye Parks Kimberly Ann Jarvis claire Lou Chapman 22 35 90 64 0 0 69 85 0 0 0 in N No 0 1 0 0 90 0 0 0 69 85 0 0 2 0 2 0 0 1 5 0 12 0 90 77 0 0 Janice Joy Rodriquez Jennifer Kay Jones Sharon Renee Nguyen Werner Allen Garcia Luis William Guerra Samuel Pate Parks Sarah Faye parks Kimberly Ann Jarvis Claire Lou Chapman Jimmy John Parker Ella Marie Feinstein Amelia Ann Napa Molli Mae Minzenmeyer Joe Allen Sanchez Roxie Leona Regan Richard Ray Alvarez J'Ron Jason MacRue Danielle Jess Miller Darcy Shea Van Pelt Brooklyn May Rosser Cade Jose Ramirez Isaiah John Smith Leah Faye Elliott Karen Mary McIntyre Leonardo Sam Gibson Kaylan Camille Keller Carson Nolan Han Bernard Jack Hart 19 29 75 0 0 66 54 0 3 0 0 2 0 53 0 O 19 66 65 69 o e o 0 88 1 #include 2 #include 3 Sinclude 4 include 5 6 using namespace std; 8 /* Constants 9 const int NUM_PATIENTS = 34; 77 Constant used to define the parallel arrays sizes se const int NUM_SYMPTOMS = 11; 11 12 r Function prototypes */ 13 int indexMostDays (int[], int); 14 double avgDaysInHospital(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() string name [NUM_PATIENTS]; //Holds the name for each patient ant patient IDINUM_PATIENTS]; /Holds the ID for each patient int age[NUM_PATIENTS); 17 Holds the age of each patient int daysInHospital [NUM_PATIENTS); 1/ Holds the number of days each patient spent in the hospital string symptom[NUM_SYMPTOMS] = {"Fever", "Cough", "Diff. Breathing", "Fatigue", "Muscle or Body Aches", "Headache", "New Loss Taste or Sim bool patientsymptoms [NUM_PATIENTS] [NUM_SYMPTOMS); 26 /* Populate all arrays reading from standard input. The data is expected to be in the following format for each patient: Patient Name(string) Patient ID(int) age(int) days (int) for (int i = 0; i > patient ID[i] >> age[i] >> days InHospital[i]; for (int j = 0; j > patientsymptoms[i][j]; cin.ignore(); 45 46 47 48 49 5e 51 1 Output the header of the table followed by a row of dashes cout - 85" e), 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 1 131 return @; 11 dummy return statement 132 ] 133 134 135 The percentage gehospitalized() 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

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

Big Data 29th British National Conference On Databases Bncod 2013 Oxford Uk July 2013 Proceedings Lncs 7968

Authors: Dan Olteanu ,Georg Gottlob ,Christian Schallhart

2013th Edition

3642394663, 978-3642394669

More Books

Students also viewed these Databases questions

Question

How does reinforcement theory work?

Answered: 1 week ago

Question

Identify psychologys main subfields.

Answered: 1 week ago

Question

a neglect of quality in relationship to international competitors;

Answered: 1 week ago