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.

Here is an example of pseudocode that meets the requirements:

```
// Initialize a counter variable to keep track of the number of games played
gamesPlayed = 0

// Initialize a variable to calculate the salary
salary = 0

// Prompt the staff member to enter 'Yes' for each game played
FOR i = 1 TO 10
PRINT "Did the junior player play a game? (Yes/No): "
READ input

// Validate the input
WHILE input is not 'Yes' or 'No' DO
PRINT "Invalid input! Please enter 'Yes' or 'No': "
READ input
END WHILE

// Increment the counter if the game was played
IF input is 'Yes' THEN
gamesPlayed = gamesPlayed + 1
END IF
END FOR

// Check if the player is eligible for a bonus
IF gamesPlayed >= 10 THEN
PRINT "The player is eligible for a bonus!"
ELSE
PRINT "The player is not eligible for a bonus."
END IF

// Calculate the salary
salary = gamesPlayed * 24000

// Display the salary to the user
PRINT "The player's salary is: R" + salary

// Confirm with the user whether they are eligible for a bonus or not
PRINT "Are you eligible for a bonus? (Yes/No): "
READ bonusEligible

// Validate the input
WHILE bonusEligible is not 'Yes' or 'No' DO
PRINT "Invalid input! Please enter 'Yes' or 'No': "
READ bonusEligible
END WHILE

// Display the final confirmation message
IF bonusEligible is 'Yes' THEN
PRINT "Congratulations! You are eligible for a bonus."
ELSE
PRINT "Sorry, you are not eligible for a bonus."
END IF
```

Note: This pseudocode assumes that the user will always enter the correct number of games played (10 in this case) and will only enter 'Yes' or 'No' as valid inputs. You may need to modify the pseudocode to handle any additional input validation or error checking that is required.

Here is the pseudocode for the given requirements:

// Initialize variables
SET bonusGames = 10
SET bonusAmount = 5000
SET basicRate = 24000
SET gameCount = 0
SET salary = 0

// Prompt user to enter game played
DISPLAY "Did the player play a game? (Enter 'Yes' or 'No')"
READ gamePlayed

// Loop until user decides not to enter any more games
WHILE gamePlayed equals 'Yes'
// Increase game count and calculate salary
SET gameCount = gameCount + 1
SET salary = salary + basicRate

// Prompt user to enter game played
DISPLAY "Did the player play another game? (Enter 'Yes' or 'No')"
READ gamePlayed
END WHILE

// Check if player is eligible for bonus
IF gameCount >= bonusGames
SET salary = salary + bonusAmount
SET eligibleForBonus = true
ELSE
SET eligibleForBonus = false
END IF

// Display player's salary
DISPLAY "The player's salary is: " + salary

// Confirm eligibility for bonus
IF eligibleForBonus equals true
DISPLAY "The player is eligible for a bonus."
ELSE
DISPLAY "The player is not eligible for a bonus."
END IF

// End the program
DISPLAY "End of program"