subject
Engineering, 21.05.2021 14:10 prettygirl2204

Write a program that prompts the user to enter the name of a football team and its foundation year. Then for each year since the foundation year till 2020, the user should enter the number of
titles won by the team. Your program should then print the average of won titles and the best
season of the team (i. e., the year in which the team won the greatest number of titles).
Note that your program should print an error message "Invalid Input!" if the user enters a
foundation year less than 1920. Besides, the number of titles won in year X should be greater than
or equal to zero. If the user enters a negative number of titles for a year X, your program should
ask the user to re-enter the number titles won in the same year X.
Your program should display all the information needed as shown in the samples' run below.
Sample run 1
I
Enter the name of your Team: Barcelona
Enter the foundation year: 2015
Enter the number of titles won in 2015: 3
Enter the number of titles won in 2016: 2
Enter the number of titles won in 2017: 2
Enter the number of titles won in 2018: 0
Enter the number of titles won in 2019: 4
Enter the number of titles won in 2020: 1
The average of titles won is 2
The best season was in 2019. Barcelona won
4 titles
Sample run 2
Enter the name of your Team: Chelsea
Enter the foundation year: 1905
Invalid Input!
Sample run 3​

ansver
Answers: 1

Another question on Engineering

question
Engineering, 03.07.2019 15:10
Apiston-cylinder with a volume of 0.25 m3 holds 1 kg of air (r 0.287 k/kgk) at a temperature of 100 c. heat transfer to the cylinder causes an isothermal expansion of the piston until the volume triples. how much heat is added to the piston-cylinder?
Answers: 3
question
Engineering, 04.07.2019 18:10
Atmospheric air has a temperature (dry bulb) of 80° f and a wet bulb temperature of 60° f when the barometric pressure is 14.696 psia. determine the specific humidity, grains/lb dry air. a. 11.4 c. 55.8 d. 22.5 b. 44.1
Answers: 1
question
Engineering, 04.07.2019 18:20
Have a greater impact on maintenance productivity than any other support group. (clo5) a)-the top management b)-inventory and purchasing c)-sub-contracting d)-cmms
Answers: 2
question
Engineering, 04.07.2019 18:20
Inspection for bearing condition will include: (clo4) a)-color b)-smell c)-size d)-none of the above
Answers: 1
You know the right answer?
Write a program that prompts the user to enter the name of a football team and its foundation year....
Questions
question
Advanced Placement (AP), 29.10.2020 23:10
question
Computers and Technology, 29.10.2020 23:10
question
History, 29.10.2020 23:10