subject

Create a class named baseballgame that contains data fields for two team names and scores for each team in each of nine innings. names should be an array of two strings and scores should be a two-dimensional array of type int; the first dimension indexes the team (0 or 1) and the second dimension indexes the inning. create get and set methods for each field. the get and set methods for the scores should require a parameter that indicates which inning’s score is being assigned or retrieved. do not allow an inning score to be set if all the previous innings have not already been set. if a user attempts to set an inning that is not yet available, issue an error message. also include a method named display in demobaseballgame. java that determines the winner of the game after scores for the last inning have been entered. (for this exercise, assume that a game might end in a tie.) create two subclasses from baseballgame: highschoolbaseballgame and littleleaguebaseballgame. high school baseball games have seven innings, and little league games have six innings. ensure that scores for later innings cannot be accessed for objects of these subtypes.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 20:00
Awide variety of “ apps “ are available to customize devices. which category of app does the word processing software fall into?
Answers: 2
question
Computers and Technology, 22.06.2019 20:00
Which type of file can be used to import data into a spreadsheet?
Answers: 1
question
Computers and Technology, 23.06.2019 23:40
Which of the following calculates the total from the adjacent cell through the first nonnumeric cell by default, using the sum function in its formula? -average -autosum -counta -max
Answers: 1
question
Computers and Technology, 24.06.2019 04:10
Write a program that reads a set of floating-point values. ask the user to enter the values, then print • the average of the values. • the smallest of the values. • the largest of the values. • the range, that is the difference between the smallest and largest. of course, you may only prompt for the values once.
Answers: 3
You know the right answer?
Create a class named baseballgame that contains data fields for two team names and scores for each t...
Questions
question
Mathematics, 20.05.2020 22:58
question
Mathematics, 20.05.2020 22:58
question
English, 20.05.2020 22:58
question
English, 20.05.2020 22:58
Questions on the website: 13722363