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
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

Declare and initialize the arrays:
points = [30, 10, 5, 20, 25, 30]
months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun']

a. Calculate the total number of points scored:
total_points = 0
for i in range(0, 6):
total_points = total_points + points[i]
Print "Total points scored:", total_points

b. Calculate the average number of points scored per month:
average_points = total_points / 6
Print "Average points scored per month:", average_points

c. Find the month with the lowest number of points:
lowest_points = points[0]
lowest_month = months[0]
for i in range(1, 6):
if points[i] < lowest_points:
lowest_points = points[i]
lowest_month = months[i]
Print "Month with the lowest points:", lowest_month

d. Find the month with the highest number of points:
highest_points = points[0]
highest_month = months[0]
for i in range(1, 6):
if points[i] > highest_points:
highest_points = points[i]
highest_month = months[i]
Print "Month with the highest points:", highest_month