Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using C# ONLY Section 3 : Enter the comment with the section title as described above. Write code to test the base class. This can
Using C# ONLY Section :
Enter the comment with the section title as described above.
Write code to test the base class. This can be done in multiple ways and should be done when thoroughly testing your code. However, for this program's output,
you will use the following method:
a Print to the console the message, "Assessment Part Classes and Inheritance" followed by a blank line.
b Print "Section : Base Class Results After Adding" to the console followed by a blank line.
c Instantiate an object called gameOne, from the scoreKeeper class, passing "Canasta" as the game name to the constructor.
d Call the addName method three times to add the players, "Larry", "Moe", and "Curly".
e Print a blank line to the console for ease of reading.
f Call the object's addScore method three times. Once for Larry, adding points to his score. A second time for Moe, adding points to Moe's score. Then
a third time for Curly, adding points to Curly's score.
g Using the listAllScores method, print a report of the players and their respective scores to the console.
h Call the object's subScore method twice. Once for Moe, subtracting points from his score. The second time, subtract points from Curly's score.
i Print "Section : Base Class Results After Subtracting" to the console followed by a blank line.
j Using the listAllScores method, print a report of the players and their respective scores to the console.
k Print two blank lines to the console.
Section :
Enter the comment with the section title as described above.
Write code to test the subclass. This can be done in multiple ways and should be done when thoroughly testing your code. However, for this program's output,
you will use the following method:
a Print "Section : Derived Class Results: Baseball Scoring" to the console followed by a blank line.
b Instantiate an object called gameTwo, from the baseball class, passing "Cubs" and "Braves" as the teams or teams of your choosing to the constructor.
Note: If you use different team names, substitute them below for 'Cubs' or 'Braves'.
c The following method calls should be done in order to guarantee the correct results.
i Call the addScore method to advance the Cubs' score by
ii Call the advOuts method three times.
iii. Call the addScore method to advance the Braves' score by
iv Call the advOuts method once.
v Call the advStrikes method once.
vi Call the advFouls method thrice.
vii. Call the advBalls method once.
viii. Call the listAllScores method to print the game and scores. Also, print a blank line to the console.
ix Use the appropriate get methods to print the current inning, outs, strikes, fouls, and balls.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started