The Sports Administration Management oversee all the soccer teams. They have considered their

budget and found that the revenue earned for the year has been exceptional.
Q.2.1 It was decided that if a junior soccer player (under 18) has played at least 10 games
during the year they will get a R5000 bonus. Each junior player earns a basic rate
of R24 000 per game that they play.
Using pseudocode, plan the logic for an application that will:
- Allow a staff member to enter ‘Yes’ for every game played.
- Count the number of times the user entered the value ‘Yes’.
- Determine if the player is eligible for a bonus.
- Calculate and display the salary of a player.
- Confirm with the user whether they are eligible for a bonus or not.
- Include at least four (4) meaningful comments.
(15)
Q.2.2 Write pseudocode and include appropriate selection structures which represent
the logic in the scenario below. Comment your pseudocode.
The Sports Administration Management has decided to offer life insurance to the
players on the various teams. If a player is older than 25 years, he will undergo a
risk assessment. If the player is a high-risk individual the premium will be 7% of
their salary. If the player is a medium-risk individual their premium will be 4% of
their salary and if the player is a low-risk individual their premium will be 2% of
their salary. A message should be displayed to the user confirming the percentage
of the salary the premium will constitute.

Q.2.1 Pseudocode:

// Initialize a counter variable to keep track of the number of games played
gamesPlayed <- 0
// Initialize a bonus amount variable
bonusAmount <- 5000
// Initialize a basic rate variable
basicRate <- 24000

// Loop until the user enters 'No' for a game played
while gamePlayed != "No":
// Prompt the user to enter if a game was played
gamePlayed <- input("Did the player play a game? (Yes/No)")
// If the user entered 'Yes', increment the gamesPlayed counter
if gamePlayed == "Yes":
gamesPlayed <- gamesPlayed + 1
// If the user entered 'No', break out of the loop

// Check if the player is eligible for a bonus
if gamesPlayed >= 10:
eligibleForBonus <- true
else:
eligibleForBonus <- false

// Calculate the salary of the player
salary <- basicRate * gamesPlayed
// Calculate the total salary with bonus if eligible
if eligibleForBonus == true:
totalSalary <- salary + bonusAmount
else:
totalSalary <- salary

// Display the calculated salary
display "The player's salary is: " + totalSalary

// Check if the player is eligible for a bonus and display the result
if eligibleForBonus == true:
display "The player is eligible for a bonus."
else:
display "The player is not eligible for a bonus."

Q.2.2 Pseudocode:

// Initialize a premium percentage variable
premiumPercentage <- 0

// Prompt the user to enter the player's age
age <- input("Enter the player's age: ")

// Check if the player is older than 25 years
if age > 25:
// Prompt the user to enter the player's risk rating
riskRating <- input("Enter the player's risk rating (high, medium, low): ")

// Check the player's risk rating and assign the appropriate premium percentage
if riskRating == "high":
premiumPercentage <- 7
else if riskRating == "medium":
premiumPercentage <- 4
else if riskRating == "low":
premiumPercentage <- 2
else:
premiumPercentage <- 0

// Display the percentage of the salary the premium will constitute
display "The premium will constitute " + premiumPercentage + "% of the player's salary."

Q.2.1 Pseudocode:

1. Set the value of bonusEligibility to False
2. Set the value of gamesPlayed to 0
3. Set the basicRate to 24000
4. Set the bonusAmount to 5000
5. Set the totalSalary to 0

6. Prompt the staff member to enter 'Yes' for each game played and store the input in playGame variable
7. If playGame is equal to 'Yes', increment the gamesPlayed by 1
8. Repeat steps 6-7 until all games have been entered

9. If gamesPlayed is greater than or equal to 10, set bonusEligibility to True
10. Calculate the salary by multiplying gamesPlayed by basicRate and add bonusAmount if bonusEligibility is True
11. Set the totalSalary to the calculated salary

12. If bonusEligibility is True, display "Congratulations! You are eligible for a bonus."
13. If bonusEligibility is False, display "Sorry, you are not eligible for a bonus."

14. Display the totalSalary to the user

Q.2.2 Pseudocode:

1. Set the age of the player
2. Set the salary of the player
3. Set the premiumPercentage to 0

4. If age is greater than 25, prompt the user to enter the risk assessment result (high, medium, or low)
5. If risk assessment result is equal to "high", set premiumPercentage to 7
6. If risk assessment result is equal to "medium", set premiumPercentage to 4
7. If risk assessment result is equal to "low", set premiumPercentage to 2

8. Calculate the premium by multiplying the salary by premiumPercentage divided by 100
9. Display the premium percentage to the user
10. Display the premium amount to the user.