Question: Python Sport players qualifies for bonus program if they count more than 20 goals or collects more than 25 assists, or gets less that 25
Python
Sport players qualifies for bonus program if they count more than 20 goals or collects more than 25 assists, or gets less that 25 penalties during the regular season.
Players that qualify for bonus under these rules are separated in 3 groups:
- Group 1: Players who have been member of the team for 5 years or more and who have played more than 55 games during the regular season. - Group 2: Players who have been member of the team for 5 years or more and who have played 55 games or less during the regular season. - Group3: Players who have been member of the team for 5 years, regardless of the number of games played during the regular season.
According to these groups,
- Group 1 players get a full bonus with the code 3 - Group 2 players get a partial bonus with the code 2 - Group 3 players get a conditional bonus with the code 1
- Players who do not belong to any of the 3 groups do not get any bonuses with the code 0
1 - Write a program that takes player statistics and gives as result the bonus code that the player obtains.
ex: the result is 3 if the player has a full bonus
2 - Write the main program that asks the user for the statistics of a player and reads them on the keyboard.
The data entered must be positive or zero and the user should be asked to enter the data until this condition is satisfied. The main algorithm calls the function of the question 1. Then the main algorithm displays the player's bonus code.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
