Write the equivalent case structure from the following selection structure. if salaryCode = 1 then output "You earn less
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Write the equivalent case structure from the following selection structure. if salaryCode = 1 then output "You earn less
Q.2.4 Write the pseudocode for the selection structure (if-else) for the following scenario and display relevant messages which indicate the outcome of the selection structure: Ⓒ The Independent Institute of Education (Pty) Ltd 2022 22; 23 The selection structure will determine if a person qualifies for a SASSA pension grant or not. The criteria listed below is not the official list of government requirements. A message must be displayed indicating if a person qualifies for the SASSA pension or not. The person must: ● be a South African citizen live in South Africa be 60 years or older Use the following variables in the selection structure. Only write the selection structure. You do not need to declare or input values into the variables for this question. ● Citizenship - will be either "yes" or "no" Residence- will be either "yes" or "no" Age - will be the person's age (e.g., 67) (5) Page 5 of 7 2022
Question 3 Q.3.1 Write the pseudocode for an application that will implement the requirements below. 22; 23 ● Q.3.2 . The Independent Institute of Education (Pty) Ltd 2022 ● Declare a numeric array called 'numbers' that has five elements. Populate the array by asking the user to input values. Use a loop. Ensure the user only enters five numbers. Ask a user whether they would like to search for a particular value. If their answer is yes, the application should allow them to enter a search value and the array must be searched for that value. (Marks: 30) Depending on if the value is found or not, an appropriate message must be displayed. Calculate and display the sum of the elements of the array. Calculate and display the average of the values in the array. Draw the flowchart for an application that will request the user to enter the radius of a circle. The radius of a circle is the distance between the centre of the circle and the edge of the circle (indicated by the red line in the diagram below). Calculate and display the area of the circle. The formula for calculating the area of a circle is: OÃ radius -area A = π xr² The calculation can also be written as: A = 3.14 x (rxr) A = area r = radius π = 3.14 (which is called Pl) (25) Page 6 of 7 2022 (5)