Question: Create a Java program to simulate some 2 team game. Ask the user to input the following information: gN - Game Name t1N - Team

Create a Java program to simulate some 2 team game. Ask the user to input the following information:

gN - Game Name

t1N - Team 1 Name

t2N - Team 2 Name

nP - # of periods (quarters, innings, periods)

sV points per score - choose one, even if game has multiple scores (i.e. football)

sN Score Name

pN Period Name

The program should work for any game such as football, baseball, hockey, basketball, soccer, etc.

Use appropriate variable names and data types for these inputs.

Also create variables to accumulate the scores for each respective team, such as team1Score, team2Score.

Input data for the 7 variables from the user.

Set up a counter controlled loop to go through the periods from 1..nP.

Tally the points for each team, then report the results, along with the winner, or if it were a tie. Create data validation loops for the 2 numeric inputs (range check for 1 through 7).

Provide 3 sets of sample output. Store the files in a .zip (not a .7zip or .rar). Here is an example of Sample Output:

Please Enter Game Name: Football

Please Enter Football Team 1 Name: Dolphins

Please Enter Football Team 2 Name: Chargers

What is a score in Football called? Touchdown

How many points per Touchdown in Football? 7

What is a period in Football called? Quarter

How many Quarters in Football? 4

Quarter #1:

How many Touchdowns for Dolphins? 2

How many Touchdowns for Chargers? 1

Quarter #2:

How many Touchdowns for Dolphins? 0

How many Touchdowns for Chargers? 1

Quarter #3:

How many Touchdowns for Dolphins? 0

How many Touchdowns for Chargers? 2

Quarter #4:

How many Touchdowns for Dolphins? 3

How many Touchdowns for Chargers? 0

Football Game Results:

------------------------------

Dolphins scored 5 Touchdowns for a score of 35

Chargers scored 4 Touchdowns for a score of 28

Dolphins Win by 7 points!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!