QUESTION Write a complete C++ program that helps the Ministry of Health (MOH) to determine the status of a zone by calculating the number of active cases for COVID 19. The program should perform the...


help(:


QUESTION<br>Write a complete C++ program that helps the Ministry of Health (MOH) to determine the status of a<br>zone by calculating the number of active cases for COVID 19. The program should perform the<br>following tasks:<br>Task 1: Write a function named dispstatus.<br>a) This is a non-returning function.<br>b) It takes the number of active cases as an input parameter.<br>c) The function should display the status of a zone based on the conditions in Table 1.<br>Table 1<br>Number of active cases<br>Above 40<br>Status of zone<br>Red<br>21 until 40<br>Orange<br>1 until 20<br>Yellow<br>No case<br>Green<br>Task 2: Write a function named getInput.<br>a) This is a non-returning function.<br>b) It takes the number of total cases, new cases, total death, and total recovered as input<br>parameters.<br>c) The function should ask the user to enter the number of total cases, new cases, total death,<br>and total recovered.<br>d) It sends all the values entered by the user in (c) back to the calling module through the<br>use of reference parameters.<br>Task 3: Write a function named dispoutput.<br>This is a non-returning function.<br>b) It takes the number of active cases as an input parameter.<br>c) The function should display the number of active cases and zone status by calling the<br>dispstatus function.<br>a)<br>Task 4: Write a function named calcAverage.<br>a) It takes the number of states and total active cases as input parameters.<br>b) The function should calculate the average number of active cases per state.<br>c) It should return the average value calculated in (b).<br>Task 5: Write a main function to perform the following tasks:<br>a) You need to use an appropriate LOOP to perform the process in this function. The loop<br>will be repeated when the user press ENTER.<br>b) You are NOT ALLOWED to use arrays except an array of characters.<br>c) The function should ask the user to enter a state name.<br>d) The function may need to call the functions that are defined in Task 2, Task 3, and Task<br>4.<br>The function should calculate the number of active cases for Covid 19 using the following<br>formula:<br>Number of active cases = Total cases + New cases - Total Death - Total Recovered<br>e)<br>f) The function should determine the state with the highest number of active cases and<br>calculate the number of states, and the total number of active cases for all states. Note:<br>You are NOT ALLOWED to use any predefined function(s) to determine the highest<br>number of active cases.<br>g) The program should produce the output as in the sample execution given below. Note:<br>The values in bold are input by the user.<br>Task 6: List all function prototypes.<br>Task 7: You must ensure your program fulfill the following criteria:<br>a) The program is able to run.<br>b) The program uses an appropriate structure for the program (e.g. all required header files<br>are included, the program is properly written, proper indentation, etc.)<br>

Extracted text: QUESTION Write a complete C++ program that helps the Ministry of Health (MOH) to determine the status of a zone by calculating the number of active cases for COVID 19. The program should perform the following tasks: Task 1: Write a function named dispstatus. a) This is a non-returning function. b) It takes the number of active cases as an input parameter. c) The function should display the status of a zone based on the conditions in Table 1. Table 1 Number of active cases Above 40 Status of zone Red 21 until 40 Orange 1 until 20 Yellow No case Green Task 2: Write a function named getInput. a) This is a non-returning function. b) It takes the number of total cases, new cases, total death, and total recovered as input parameters. c) The function should ask the user to enter the number of total cases, new cases, total death, and total recovered. d) It sends all the values entered by the user in (c) back to the calling module through the use of reference parameters. Task 3: Write a function named dispoutput. This is a non-returning function. b) It takes the number of active cases as an input parameter. c) The function should display the number of active cases and zone status by calling the dispstatus function. a) Task 4: Write a function named calcAverage. a) It takes the number of states and total active cases as input parameters. b) The function should calculate the average number of active cases per state. c) It should return the average value calculated in (b). Task 5: Write a main function to perform the following tasks: a) You need to use an appropriate LOOP to perform the process in this function. The loop will be repeated when the user press ENTER. b) You are NOT ALLOWED to use arrays except an array of characters. c) The function should ask the user to enter a state name. d) The function may need to call the functions that are defined in Task 2, Task 3, and Task 4. The function should calculate the number of active cases for Covid 19 using the following formula: Number of active cases = Total cases + New cases - Total Death - Total Recovered e) f) The function should determine the state with the highest number of active cases and calculate the number of states, and the total number of active cases for all states. Note: You are NOT ALLOWED to use any predefined function(s) to determine the highest number of active cases. g) The program should produce the output as in the sample execution given below. Note: The values in bold are input by the user. Task 6: List all function prototypes. Task 7: You must ensure your program fulfill the following criteria: a) The program is able to run. b) The program uses an appropriate structure for the program (e.g. all required header files are included, the program is properly written, proper indentation, etc.)
SAMPLE PROGRAM EXECUTION<br><<<<<<<<<<<<<< DATA >>>>>>>>>>>>><br>: Negeri Sembilan<br>: 7103<br>: 57<br>: 11<br>State name<br>Total cases<br>New cases<br>Total death<br>Total recovered: 6274<br>くくくくくくくくくくくくく SUMMARY >>>>>>>>>>><br>: 875<br>: Red zone<br>Active cases<br>Status<br>Press <ENTER> to continue...<br><<<<<<<<<<<<<< DATA >>>>>>>>>>>>><br>: Johor<br>: 3421<br>: 167<br>: 32<br>State name<br>Total cases<br>New cases<br>Total death<br>Total recovered: 1985<br><<<<<<<<<<<<< SUMMARY >>>>>>>>>>><br>: 1571<br>: Red zone<br>Active cases<br>Status<br>Press <ENTER> to continue...<br><<<<<<<<<<<<<< DATA >>>>>>>>>>>>><br>: Perak<br>: 2888<br>: 17<br>: 16<br>State name<br>Total cases<br>New cases<br>Total death<br>Total recovered: 2503<br>くくくくくくくくくくくくく SUMMARY >>>>>>>>>>><br>: 386<br>: Red zone<br>Active cases<br>Status<br>Press <ENTER> to continue...<br>くくくくくくくくくくくくくく DATA >>>>>>>>>>>>><br>: Perlis<br>: 44<br>: 1<br>: 2<br>State name<br>Total cases<br>New cases<br>Total death<br>Total recovered: 41<br><<<<<<<<<<<<< SUMMARY >>>>>>>>>>><br>: 2<br>: Yellow zone<br>Active cases<br>Status<br>Press <ENTER> to continue...<br><<<<<<<<<<<<<< DATA >>>>>>>>>>>>><br>: Pulau Pinang<br>: 2978<br>: 23<br>: 9<br>State namme<br>Total cases<br>New cases<br>Total death<br>Total recovered: 2743<br><<<<<<<<<<<<< SUMMARY >>>>>>>>>>><br>: 249<br>: Red zone<br>Active cases<br>Status<br>Press <ENTER> to continue...N<br><<<<<<<<< ACTIVE CASES >>>>>>>>>><br>Total : 3083<br>Highest: 1571 (Johor)<br>Average for 5 states: 616<br>

Extracted text: SAMPLE PROGRAM EXECUTION < data="">>>>>>>>>>>>> : Negeri Sembilan : 7103 : 57 : 11 State name Total cases New cases Total death Total recovered: 6274 くくくくくくくくくくくくく SUMMARY >>>>>>>>>>> : 875 : Red zone Active cases Status Press to continue... < data="">>>>>>>>>>>>> : Johor : 3421 : 167 : 32 State name Total cases New cases Total death Total recovered: 1985 < summary="">>>>>>>>>>> : 1571 : Red zone Active cases Status Press to continue... < data="">>>>>>>>>>>>> : Perak : 2888 : 17 : 16 State name Total cases New cases Total death Total recovered: 2503 くくくくくくくくくくくくく SUMMARY >>>>>>>>>>> : 386 : Red zone Active cases Status Press to continue... くくくくくくくくくくくくくく DATA >>>>>>>>>>>>> : Perlis : 44 : 1 : 2 State name Total cases New cases Total death Total recovered: 41 < summary="">>>>>>>>>>> : 2 : Yellow zone Active cases Status Press to continue... < data="">>>>>>>>>>>>> : Pulau Pinang : 2978 : 23 : 9 State namme Total cases New cases Total death Total recovered: 2743 < summary="">>>>>>>>>>> : 249 : Red zone Active cases Status Press to continue...N < active="" cases="">>>>>>>>>> Total : 3083 Highest: 1571 (Johor) Average for 5 states: 616
Jun 03, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here