Question: computer Programming QUESTION 5 (15 MARKS) c. Write a complete program that has ONE (1) user-defined function. This function will apply pass by reference AND/

computer Programming

computer Programming QUESTION 5 (15 MARKS) c. Write a complete program that

has ONE (1) user-defined function. This function will apply pass by reference

AND/ OR pass by value, to calculate and display the value of

QUESTION 5 (15 MARKS) c. Write a complete program that has ONE (1) user-defined function. This function will apply pass by reference AND/ OR pass by value, to calculate and display the value of y. Given formula y = (x + x + 4). (6 marks) I d. Write the definition of the following functions i ii below: iii. void User Input (int num[], int size) This function asks FOUR (4) integer numbers from user and store the numbers in the array num[]. (3 marks) iv. int SumPowerTwo (int num[], int size) This function displays the square of every even number in array num [] and returns the sum of all numbers in num[]. Use built-in function to get the square of numbers. (6 marks) PART B ESSAY QUESTIONS) - 30 MARKS Coronavirus Disease 2019 (COVID-19) is an infectious disease that can cause respiratory illness To combat this infectious disease from spreading, the Malaysian government introduced th Colour Zone Indicator to classify affected areas as Green, yellow, Orange and Red base on the number of cases as shown in Table 1. Table 1: Zone Classification Number of cases Indicator 0 Green 1 - 20 Yellow 21 - 40 Orange 41 and above Red Write a program that can read and keep the records of cases. The structure of the data named classify and its fields is as follows: Record Field Description districtName District name (30 characters) totalcase Total number of cases (integer value) readingCase An array that keep FIVE (5) numbers of case readings (integer value) of FIVE (5) days indicator Indicator based on Table 1(10 characters) The program must contain the following user-defined functions: d. read(): This function reads/gets the data for THREE (3) district names and FIVE (5) number of case readings of FIVE (5) days for each district. e. total_and_indicator (): This function will calculate the total number of cases and determine the colour zone indicator for each district. f display(): This function displays all required data - the district name, the total number of cases and the zone indicator (30 marks)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!