AFL Score
A game in the Australian Football League consists of two teams aiming to achieve the highest score. The score calculated from the number of goals and behinds each team kicks. A goal is worth six (6) points, and a behind is worth one (1) point. You can read further on this in the AFL explained scoring page.
Build a program that allows the user to enter details of an AFL game, output scores and winners, and provide a menu for the user to update game details and output scores.
An example of this running is shown below.
Welcome to the AFL score calculator!
Enter team 1 details:name: Hawksgoals: fivePlease enter a whole numbergoals: 5behinds: 12.1Please enter a whole numberbehinds: 12
Enter team 2 details:name: Catsgoals: 7behinds: 3
Calculating details...The Cats are winning
Hawks: 5, 12, 42Cats: 7, 3, 45
Menu:1: Update Hawks goals2: Update Hawks behinds3: Update Cats goals4: Update Cats behinds5: Print details6: QuitOption: 7Please enter a number between 1 and 6Option: fourPlease enter a whole numberOption: 4behinds: 0
Menu:1: Update Hawks goals2: Update Hawks behinds3: Update Cats goals4: Update Cats behinds5: Print details6: QuitOption: 5
Calculating details...It is currently a draw!
Hawks: 5, 12, 42Cats: 7, 0, 42
Menu:1: Update Hawks goals2: Update Hawks behinds3: Update Cats goals4: Update Cats behinds5: Print details6: QuitOption: 6
Are you sure you want to quit? [Y/n]: 1Please enter y or nAre you sure you want to quit? [Y/n]: YesPlease enter y or nAre you sure you want to quit? [Y/n]: y
Bye!