Write a complete C++ program, to determine whether or not a person is eligible for Malaysian Family Assistance. The program should be able to do the following tasks: Task 1: Write a "getInput" function. a) This is a function that does not return any values. b) It accepts as input parameters the identity card (IC) number, gross monthly income, eligibility status, and number of children. c) The function should prompt the user to enter their IC number, gross monthly income, and the number of children they have if they are eligible. A person is eligible for this assistance if their gross monthly income does not exceed RM5000. d) The function returns to the calling module all of the values entered by the user in (c), as well as the eligibility status using reference parameters. Task 2: Write a "deterAmountAssist" function. a) It accepts as input parameters the gross monthly income and the number of children. b) The function should determine the amount of assistance received by those who are eligible based on the criteria listed in Table 1. c) It should return the value determined in (b). Table 1 Gross monthly income (RM) Number of children 0 1 – 2 ≥ 3 2,500 and below RM1,000 RM1,500 RM2,000 2,501 – 5,000 RM400 RM600 RM800 Task 3: Write a main function. a) You need to use an appropriate LOOP to perform the process in this function. The loop will be repeated when the user press ‘Y’ or ‘y’. b) You are NOT ALLOWED to use arrays except an array of characters. c) The function may need to call the functions defined in Task 1 and Task 2. d) The program should generate the output shown in the sample execution below. The values in bold are those entered by the user. Task 4: You must ensure that your program meet the following criteria: (5 marks) a) The program can be executed. b) The program employs 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 << Check eligibility for Malaysian Family Assistance >> IC number: 720322015617 Gross monthly income: RM6543.23 Status: NOT ELIGIBLE Press 'Y' to enter other data: y
Write a complete C++ program, to determine whether or not a person is eligible for Malaysian
Family Assistance. The program should be able to do the following tasks:
Task 1: Write a "getInput" function.
a) This is a function that does not return any values.
b) It accepts as input parameters the identity card (IC) number, gross monthly
income, eligibility status, and number of children.
c) The function should prompt the user to enter their IC number, gross monthly
income, and the number of children they have if they are eligible. A person is
eligible for this assistance if their gross monthly income does not exceed
RM5000.
d) The function returns to the calling module all of the values entered by the user in
(c), as well as the eligibility status using reference parameters.
Task 2: Write a "deterAmountAssist" function.
a) It accepts as input parameters the gross monthly income and the number of
children.
b) The function should determine the amount of assistance received by those who
are eligible based on the criteria listed in Table 1.
c) It should return the value determined in (b).
Table 1
Gross monthly income (RM) |
Number of children | ||
0 | 1 – 2 | ≥ 3 | |
2,500 and below | RM1,000 | RM1,500 | RM2,000 |
2,501 – 5,000 | RM400 | RM600 | RM800 |
Task 3: Write a main function.
a) You need to use an appropriate LOOP to perform the process in this function.
The loop will be repeated when the user press ‘Y’ or ‘y’.
b) You are NOT ALLOWED to use arrays except an array of characters.
c) The function may need to call the functions defined in Task 1 and Task 2.
d) The program should generate the output shown in the sample execution below.
The values in bold are those entered by the user.
Task 4: You must ensure that your program meet the following criteria: (5 marks)
a) The program can be executed.
b) The program employs 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
<< Check eligibility for Malaysian Family Assistance >>
IC number: 720322015617
Gross monthly income: RM6543.23
Status: NOT ELIGIBLE
Press 'Y' to enter other data: y
Step by step
Solved in 2 steps with 2 images