Question
CPS 180 - Lab Assignment #6: Team Game Scoring Assignment Assigned: 06/02/17 Due: 06/09/17 Points: 40 Create a Java program to simulate some 2 team
CPS 180 - Lab Assignment #6:
Team Game Scoring Assignment
Assigned: 06/02/17 Due: 06/09/17 Points: 40
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started