Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

If your program does not compile, you will not receive any points You will write a program to keep up with a Baseball team (The

image text in transcribed
image text in transcribed
If your program does not compile, you will not receive any points You will write a program to keep up with a Baseball team (The team and players can be real or not) using Object-Oriented Programming (OOP). The important aspect of object-oriented programming is modular development and testing of reusable software modules You love Baseball and you have a head for the stats and programming and have decided to track a team's players and some of the stats. You will need the five classes discussed below. You will have a Player class, with class attributes of a player's name, that player's batting average (this can be an integer or double you decide, however if it's an integer you will need to include a when you print the value and if you use a double for the batting average, and the average is something like .310, the last 0 will not be printed, so you will need to account for it.), and what position the player plays on the field. Make sure these variables are safe (inaccessible from outside of this class) A Test_Player class, that is a Junit test class for the Player class. This should contain at least 7 test methods (1 for the empty Constructor, 3 for the non-empty Constructor, and 3 for the setters. The getters will be tested several times in the other tests) that tests the methods of the Player class You will need a Club class, with class attributes of your Baseball Clubs name, an Array (default size of 10) of Player's that play for the Club, and a counter to keep track of the logical length of the array A Test Club class, that is a Junit test class for the Club class. This should contain at least 6 test methods (1 for the empty Constructor, 1 for the non-empty Constructor, 1 for the setter, and 3 for the add method) that tests the methods of the Club class. Your P1 Driver has a class attribute of a Baseball Club (there should be no variable for a Player object in this class). All the data for the Club and Player classes are to be hard coded (Do Not ask the user for that data). - Your program will need to: Include the programming standards found in Blackboard. - The hardcoded data for the Club and Player classes should be in the P1 Driver and passed to the appropriate methods of the other classes : Print thelane of your Baseball Club and all the Player's (you must a welcoming message have at least 5 different Player's for the Club), including the Player's name, batting average (be sure to have different batting averages, don't make them all .300 or something dumb like that), and player's position Calculate and print the average batting average of the Player's on the Club. Be sure that this average looks like a normal batting average (i.e: .250 and not .25000364) Print a Good-Bye message or Thank you. Late programs will have points deducted per day late. If your

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2019 Wurzburg Germany September 16 20 2019 Proceedings Part 2 Lnai 11907

Authors: Ulf Brefeld ,Elisa Fromont ,Andreas Hotho ,Arno Knobbe ,Marloes Maathuis ,Celine Robardet

1st Edition

3030461467, 978-3030461461

More Books

Students also viewed these Databases questions