Pseudocode:
1. Input player's age
2. Input player's risk assessment (high-risk, medium-risk, low-risk)
3. Input player's salary
4. If age > 25, do steps 5-8
5. If risk assessment is "high-risk", set premium percentage to 7. Print "Premium will be 7% of salary."
6. If risk assessment is "medium-risk", set premium percentage to 4. Print "Premium will be 4% of salary."
7. If risk assessment is "low-risk", set premium percentage to 2. Print "Premium will be 2% of salary."
8. Print "Thank you for choosing our life insurance service."
Selection structure explanation:
- The program begins by inputting the player's age, risk assessment, and salary.
- If the player's age is greater than 25, the program goes into the selection structure.
- Within the selection structure, the program checks the risk assessment and sets the premium percentage accordingly.
- Based on the risk assessment, the program prints the appropriate message confirming the percentage of the salary the premium will constitute.
- Finally, after the selection structure, a message thanking the user is printed.
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.
1 answer