1. Declare an array called "points" to store the player's points for each month.
2. Declare an array called "months" to store the names of the months.
3. Populate the "points" array with the given data: {"Jan": 30, "Feb": 10, "Mar": 5, "Apr": 20, "May": 25, "Jun": 30}.
4. Populate the "months" array with the given data: {"Jan", "Feb", "Mar", "Apr", "May", "Jun"}.
5. Initialize a variable called "totalPoints" to 0.
6. Initialize a variable called "lowestPoints" with a large value initially.
7. Initialize a variable called "highestPoints" with a small value initially.
8. Initialize a variable called "lowestMonth" with an empty string initially.
9. Initialize a variable called "highestMonth" with an empty string initially.
10. Iterate through each element in the "points" array.
a. Add the current element to the "totalPoints" variable.
b. Check if the current element is lower than the "lowestPoints" variable.
i. If true, update the "lowestPoints" variable with the current element.
ii. Update the "lowestMonth" variable with the corresponding month from the "months" array.
c. Check if the current element is higher than the "highestPoints" variable.
i. If true, update the "highestPoints" variable with the current element.
ii. Update the "highestMonth" variable with the corresponding month from the "months" array.
11. Calculate the averagePoints by dividing the "totalPoints" by the length of the "points" array.
12. Print the "totalPoints".
13. Print the "averagePoints" rounded to the nearest integer.
14. Print the "lowestMonth".
15. Print the "highestMonth".
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
1 answer