Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Display the menu(once at beginning of Game) 2. Display the Scores for both Ho

ID: 3622425 • Letter: 1

Question

1. Display the menu(once at beginning of Game)

2. Display the Scores for both Home and Visitor teams, Down number, Team that has possession of the ball or has just received a kicked ball, and the Quarter

3. When halftime occurs, report the half-time score as indicated.

4. At the end of the 4th Quarter Report the Final Score and ask if they would like to start a new game. If yes then run an entirely new game (teams/score, etc.) from the beginning at the first quarter.

5. If the event is C then the program shall terminate (stop) immediately.

6. Game Rules are as follows (Our program not NFL)
a) No yards will be given in fractions
b) The Ball will change possession at the end of the 2nd Quarter of first half. The Team not possessing the ball originally will now begin with possession. There is No change of possession and yardage at the end of the 1st and 3rd quarters
c) Each time the ball changes possession the team starts out with 1st down and 10 Yards
d) Possession of the ball will change from one team to the other when any of the following occur, Field Goal, Goal, Turnover, Safety, End half as stated in (2) or upon the failure to make 10 yards in 4 downs. (If at the end of the 4th down there are still yards to go the possession goes to the other team.
e) A field goal scores 3 pts for the Team in possession.
f) A safety scores 2 pts for the Team NOT in possession.
g) A Goal scores 6 points for the team in possession and you need to ask for the extra points, which may be either 0, 1, or 2 only.
h) For penalties the team receiving the penalty must be entered, as either H or V, repeat of down will be asked for Y or N. Also the number of yards the penalty should be reflected in the down and yards status. Make sure that the downs and yards to 1st down are updated correctly.

7. The menu is:

Event Code

Description

Event Code

Description

y

Yardage made or lost on play

t

Ball turned Over

f

Field Goal

q

Quarter is over

g

Goal (touchdown)

p

Penalty Flag

s

Safety

C

Game Canceled

Here is a picture of the output:

I am using Dev C++ so make sure the code runs and compiles. This is an entry level class I assume this program just involves a series of loops.

If the program runs and matches the output exactly a lifesaver is gladly given.

Event Code

Description

Event Code

Description

y

Yardage made or lost on play

t

Ball turned Over

f

Field Goal

q

Quarter is over

g

Goal (touchdown)

p

Penalty Flag

s

Safety

C

Game Canceled

Explanation / Answer

Hope this helps. Let me know if you have any questions. Please rate. :) Sorry the code isn't incredibly clean. There are a lot of rules for this program, so it seems to degrade to a series of if statements, heh. This should work though. I suggest you put it into an editor and auto-format so that indentations show correctly and it's a little more clear what is actually happening when. #include #include using namespace std; int main() { bool anotherGame = true, gameIsOver = false; bool homeHasBall; string home, visitor, qrtrStr, hasBallStr; char receiving, choice; int quarter, homeScore, visitorScore, down, yardsTo1stDown; cout home; cout > visitor; cout > receiving; if (tolower(receiving) == 'h') homeHasBall = true; else homeHasBall = false; cout