Question: The purpose of this assignment is to practice using object - oriented programming principles and streams to solve data management problems. This assignment will guide
The purpose of this assignment is to practice using objectoriented programming principles and streams to solve data management problems. This assignment will guide you through writing classes for use in a hypothetical database application. By the end of this assignment, you will have:Defined a parent class, consisting of both attributes and methodsDefined child classes that build off of the parent classUsed method overridingUsed access modifiers to safeguard user dataImplemented constructors for child and parent classesUsed IO streams to load and process data.The scenario. Suppose you are managing a junior basketball league. Your task is to design classes that could be used to implement a database to manage the players. The league consists of four groups: sixth and seventhgrade boys and girls.The league has three teams for each group: the Lions, the Tigers, and the Bearswhich makes for teams total. Example: th grade boys Tigers is a separate team from th grade girls TigersWhen participants sign up they are assigned a team in rotation. For example, the first th grade boy to sign up is assigned to the Lions. The second boy is assigned to the Tigers, and the third the Bears. The fourth th grade boy is then assigned to the Lions, and the rotation continues.This assignment is divided into two parts.PART I. In this first part, we are focused on setting up the classes for use in the database. In the followup assignment, we'll work with files and elementary data structures to implement the database in accordance with the league rules.Task Design a Team class.The Team class should include these three private attributes: team name, grade level, and gender. Pick appropriate variable types to use. In the comments, justify your choices.The Team class should have a constructor that requires the name, grade level, and gender data to be supplied.The Team class should have a fourth private attribute: roster, which is an array of objects of class Player to be defined shortly The constructor should initialize this array to be an empty arrayThe Team class should have a public method assignPlayer that takes a variable of type Player as input and appends that player to the roster.The Team class should have a public method printRoster that prints the names of all of the players in format last name, first nameTask Design a Kid class.The Kid class should include these private attributes: first name, last name, grade level, and gender. Pick appropriate variable types to use. In the comments, justify your choices.The Kid class should have a constructor that requires both names, grade level, and gender.The Kid class should have a public method printInfo that prints their name, grade, and gender to the terminal.Task Design a Player class.The Player class should extend the Kid class. It should include a new private attribute: team of class TeamThe method printInfo should be print their name, grade, gender, and assigned team to the terminal.Verifying that your code works. To verify your code works, you can write a sample program that does the following: Create an instance of the Team class and give it a test name Create an instance of the Player class and give the player a test name and test values for the other attributes Call the team's assign method to assign the player to the team Call the team's roster method to test that the roster print code works Call the player's printInfo method to verify that method is workingPART II Your goal is to write a program that reads the file team.txt found on the Moodle shell A 'Player' object should be created for each kid listed in the input file. To create the Player object, you will need to assign each kid to a team. The assignment should be done in rotation" as described earlier in the handout.When all of the kids have been assigned to a team, your program should print the information for each player to the terminal, and also print the team's information. Use the printInfo methods for each team and player to do this.Your program can solve this problem in any way you feel is reasonable. Please give a brief written description of how your program solves the rotation problem assigning kids to a team in the comments.The input file is a plain text file. Each kid's info is printed on a line. The data given is: last name, first name, grade level, genderIf you have questions or need clarification, please don't hesitate to reach out to me As with all homework assignments, you are welcome to share ideas so long as everyone turns in their own code.
erwin, blair,
erwin,bradley,
pelfrey,ryan,
pelfrey,cory,
witte,caitlyn,
witte,parker,
shorter,cole,
jerden,kelly,
jerden,lauren,
sako,nadima,
sako,manga,
sako,benazir,
deichler,katherine,
jackson,anna,
farris,kristin,
hansen,matt,
kimmons,lindsey,
kimmons,andy,
kimmons,leslie,
lofgren,eric
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
