Question 3 (Marks: 25)

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. Initialize the following arrays:

- points[6] // an array to store the points scored by the player each month
- month[6] // an array to store the names of the months

2. Read the values for points array and month array from the given data.

3. Calculate the total number of points scored:
- Initialize a variable totalPoints to 0
- Use a loop to iterate through each element in the points array
- Add the current element to totalPoints

4. Calculate the average number of points scored per month:
- Initialize a variable averagePoints to 0
- Divide totalPoints by 6 and assign the result to averagePoints

5. Find the month during which the lowest number of points were scored:
- Initialize a variable lowestPointsIndex to 0
- Use a loop to iterate through each element in the points array (starting from index 1)
- If the value at the current index is less than the value at lowestPointsIndex
- Update lowestPointsIndex with the current index

6. Find the month during which the highest number of points were scored:
- Initialize a variable highestPointsIndex to 0
- Use a loop to iterate through each element in the points array (starting from index 1)
- If the value at the current index is greater than the value at highestPointsIndex
- Update highestPointsIndex with the current index

7. Print the following information:
- The total number of points scored during the first six months: totalPoints
- The average number of points scored per month: averagePoints
- The month during which the lowest number of points were scored: month[lowestPointsIndex]
- The month during which the highest number of points were scored: month[highestPointsIndex]

To generate a report showing the required information, here is the pseudocode:

1. Initialize parallel arrays for points and months:
- Define an array "points[]" to store the points earned each month.
- Define an array "months[]" to store the names of the months in order.

2. Read the points earned during the first six months of the year and store them in the "points[]" array.
- Initialize a loop to iterate through each month:
- Read the points earned for the current month and store it in the "points[]" array.

3. Calculate and display the total number of points scored by the player during the first six months of the year:
- Declare a variable "totalPoints" and set it to zero.
- Iterate through each element in the "points[]" array:
- Add the value of each element to the "totalPoints" variable.
- Display the value of "totalPoints".

4. Calculate and display the average number of points scored by the player per month:
- Declare a variable "averagePoints" and set it to zero.
- Divide the value of "totalPoints" by 6 (the number of months) and assign the result to "averagePoints".
- Display the value of "averagePoints".

5. Find and display the month during which the lowest number of points were scored by the player:
- Declare a variable "lowestPointsIndex" and set it to 0.
- Iterate through each element in the "points[]" array:
- If the value of the current element is less than the value at "points[lowestPointsIndex]", update "lowestPointsIndex" to the index of the current element.
- Display the month name from the "months[]" array at index "lowestPointsIndex".

6. Find and display the month during which the highest number of points were scored by the player:
- Declare a variable "highestPointsIndex" and set it to 0.
- Iterate through each element in the "points[]" array:
- If the value of the current element is greater than the value at "points[highestPointsIndex]", update "highestPointsIndex" to the index of the current element.
- Display the month name from the "months[]" array at index "highestPointsIndex".

This pseudocode outline can be translated into any programming language to implement the functionality described.