Question: Write a program that prompts the user to enter the Houston Texans last six (6) regular season scores. The scores should be saved in two
Write a program that prompts the user to enter the Houston Texans last six (6) regular season scores. The scores should be saved in two different arrays, named texansScore[] and opponentsScore[].
Assumption 1: Texans need to win at least four (4) games out of six (6) games to get a spot in playoffs.
Assumption 2: Games will not finish with a tie.
The program should display:
after each game you need tell how many more games Houston Texans need to win to get a spot on Playoffs. If Texans is eliminated to have a spot on playoffs (i.e. losing the first three games), you need to tell that Texans are eliminated from the playoffs.
if Houston Texans made it to Playoffs
the percentage of games won by the Houston Texans,
the averages of Houston Texans and Opponents score. These average scores should be separated by wins and lost
the lowest score of Houston Texans and the corresponding game number,
the largest deficit in a game and corresponding game number (if there is any).
For example:
If the user enters the following data for Texans, and
| 37 | 39 | 47 | 35 | 16 | 34 |
if the user enters the following data for Opponents Score
| 20 | 56 | 18 | 28 | 20 | 26 |
Output:
Texans: 37
Opponent: 20
Texans need to win 3 more games out of 5 to have a spot in playoffs.
Texans: 39
Opponent: 56
Texans need to win 3 more games out of 4 to have a spot in playoffs.
Texans: 47
Opponent: 18
Texans need to win 2 more games out of 3 to have a spot in playoffs.
Texans: 35
Opponent: 28
Texans need to win 1 more games out of 2 to have a spot in playoffs.
Texans: 16
Opponent: 20
Texans need to win 1 more games out of 1 to have a spot in playoffs.
Texans: 34
Opponent: 26
Texans need to win 0 more games out of 0 to have a spot in playoffs.
Texans made it to Playoffs
Winning Percentage is: 66%
Texans Average scores (win): 38.25
Texans Average scores (lost): 27.5
Opponents Average scores (win): 38
Opponents Average scores (lost): 23
Lowest Houston Texans score was 16 in the 5th game.
Largest deficit was 17 and occurred in the 2nd game.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
