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 object-oriented 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 I/O 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 seventh-grade boys and girls.The league has three teams for each group: the Lions, the Tigers, and the Bears--which makes for 12 teams total. (Example: 6th grade boys Tigers is a separate team from 7th grade girls Tigers).When participants sign up, they are assigned a team in rotation. For example, the first 6th 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 6th 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 follow-up assignment, we'll work with files and elementary data structures to implement the database in accordance with the league rules.Task 1. 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 name)Task 2. 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 3. Design a Player class.The Player class should extend the Kid class. It should include a new private attribute: team (of class Team).The 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:1. Create an instance of the Team class and give it a test name2. Create an instance of the Player class and give the player a test name (and test values for the other attributes)3. Call the team's assign method to assign the player to the team4. Call the team's roster method to test that the roster print code works5. 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,6,f
erwin,bradley,6,m
pelfrey,ryan,6,m
pelfrey,cory,6,m
witte,caitlyn,6,f
witte,parker,6,m
shorter,cole,6,m
jerden,kelly,6,f
jerden,lauren,6,f
sako,nadima,6,f
sako,manga,6,f
sako,benazir,6,m
deichler,katherine,6,f
jackson,anna,6,f
farris,kristin, ,7,f
hansen,matt,7,m
kimmons,lindsey,7,f
kimmons,andy,7,m
kimmons,leslie,7,f
lofgren,eric
The purpose of this assignment is to practice

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 Programming Questions!