Inlab 4: A Baseball League

Due: Wednesday 13 July at 6:00 pm



This is an individual assignment, though collaboration (not solution sharing) is allowed.

Problem Statement

You will build a program that represents baseball teams. To do this, you need two classes. The Player class will represent a baseball player and the Team class will represent a baseball team. A Player will consist of a name, the number of at bats they had (you are required to make this an integer), and the number of hits they had (again, must be an int). A Team will consist of three (exactly three) Players and a team name. You will then build methods that will calculate the batting average of the individual players and the overall team. NOTE: Batting Average = numHit / numAtBats.


Bonus Point


By Wednesday afternoon at 6:00 pm, submit the files,, and (if you worked on the bonus point part) into the appropriate D2L dropbox folder. DO NOT SUBMIT .class files.

Grading - 10 points