The Sports Administration Management must manage each player’s performance and are

therefore required to review the players’ performance every six months. Points are earned as
follows: Three (3) points for each goal scored and two (2) points for a penalty.
The data below represents the performance of one player during the first six months of the year.
Use this data to populate the arrays.
Points 30 10 5 20 25 30
Month Jan Feb Mar Apr May Jun
Q.3.1 Write the pseudocode for an application that will generate a report that will show
the following information:
a. The total number of points the player scored during the first six months of
the year.
b. The average number of points the player scored per month.
c. The month during which the lowest number of points were scored by the
player.
d. The month during which the highest number of points were scored by the
player.
Note: You must use parallel arrays as part of your answer.

1 answer

1. Declare and initialize the parallel arrays for points and months.
- Declare an array called "points" and initialize it with the given data: [30, 10, 5, 20, 25, 30]
- Declare an array called "months" and initialize it with the given data: ["Jan", "Feb", "Mar", "Apr", "May", "Jun"]

2. Calculate and display the total number of points scored by the player.
- Initialize a variable called "totalPoints" to 0.
- Loop through the "points" array and add each element to "totalPoints".
- Display the value of "totalPoints".

3. Calculate and display the average number of points scored per month.
- Initialize a variable called "averagePoints" to 0.
- Divide "totalPoints" by the length of the "points" array and store the result in "averagePoints".
- Display the value of "averagePoints".

4. Find and display the month during which the lowest and highest number of points were scored by the player.
- Initialize variables called "lowestPoints" and "highestPoints" to the first element of the "points" array.
- Initialize variables called "lowestMonth" and "highestMonth" to the first element of the "months" array.
- Loop through the "points" array from the second element.
- If the current element is less than "lowestPoints", update "lowestPoints" to the current element and "lowestMonth" to the corresponding element of the "months" array.
- If the current element is greater than "highestPoints", update "highestPoints" to the current element and "highestMonth" to the corresponding element of the "months" array.
- Display the values of "lowestMonth" and "highestMonth".

5. End the program.