Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Objectives: We know the benefits of using classes in java. However, what if we want to create a class inside of a class? Is this

Objectives: We know the benefits of using classes in java. However, what if we want to create a class inside of a class? Is this even possible? Yes, it is. This is known as nested classes. A programmer may want to do this when they want to group classes logically, increase encapsulation, and make code more maintainable and readable. By completing this assignment, students will demonstrate knowledge of creating nested classes.
Task Description: The sports association wants you to continue development of the soccer league. Using your previous assignment on the soccer league, you will add some additional features. They want to be able to track in-game statistics. These should be built in as nested classes in the Player and Team classes.
Class Layout (Game and Coach classes are omitted because they do not change):
Team (Class):
Name
City
Color
Roster(ArrayList of players)
Statistics (Class):
Team Goals
Team Assists
Team Tackles
Wins
Losses
Ties
Player (Class):
Name
Age
Position
Team
Statistics (Class):
Goals
Assists
Tackles
Saves (Goalkeeper saves)
You are supplied with a playerStats.txt file. This file contains the statistics for players. Each player is identified by name and team name. These statistics are taken from different games, so as they are being read each they should be added to the appropriate player's stats as well as the team's stats.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions