Question: Task 3: Write a function named dispoutput. (4 marks) a) This is a non-returning function. b) It takes the number of active cases as an
Task 3: Write a function named dispoutput. (4 marks) 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 number of active cases and zone status by calling the dispStatus function. Task 4: Write a function named calcAverage. (4 marks) 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). Question 165 Marks 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. (10 marks) 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 Status of zone Above 40 Red 21 until 40 Orange 1 until 20 Yellow No case Green Task 2: Write a function named getInput. (7 marks) 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 (e) back to the calling module through the use of reference parameters. Task 3: Write a function named dispOutput. (4 marks) 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 number of active cases and zone status by calling the dispStatus function. Task 4: Write a function named calcAverage. (4 marks) 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)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
