All your Writing needs covered

Develop and apply an appropriate and useful inheritance hierarchy

Calculate the price
of
your order:

275 words
+
Approximate price
$ 0.00

Develop and apply an appropriate and useful inheritance hierarchy    Develop and apply an appropriate and useful inheritance hierarchy. Use multiple cpp and header files effectively to develop modular code. Background Assume that all baseball players, regardless of their position, have these two important statistics: • rbi – runs batted in, a whole number (so you must data type int) • batting average – real number percentage of hits per at-bat (a real number, so you must use data type double) Pitchers are baseball players with an additional statistic, era (earned run average), a real number for earned runs per nine innings pitched (so you must use data type double). Developing the Class Hierarchy A logical class hierarchy for these two types of objects would use a Player class as a parent (base) class for a derived (child) Pitcher class. The Pitcher class would include all the members of the Player class and have an additional (private) era data member, and, of course, appropriate (public) accessor, mutator and constructor methods. This relationship is sometimes called a tree, but is also called a hierarchy, more particularly in this case, a class hierarchy. Note that the arrow points from derived (child) class to parent (base) class, which indicates the search path for executing member methods; if the method is not found in the Pitcher class, the compiler looks back to the parent class, Player, to find it. File Organization (Class Header and Implementation Files, etc.) Each class (in this case Player and Pitcher) will have its own header (.h) and implementation (.cpp) file, and, of course, there needs to be an executable file that actually uses the class (an application .cpp file with a main function). As with the classes previously developed in the course, the application will be a “driver” program that executes each member function at least once with an arbitrary, but specific test case data set. Requirements Use the given Player class as a base class for Pitcher and add to the BaseballPlayerDriver file code to test the class with the data specified below. Player class requirements: 1. Create with separate header (Player.h) and implementation (Player.cpp) files. 2. Two private data members, rbi and battingAverage. 3. A parameterized constructor that receives and sets the initial values for both rbi and battingAverage. 4. Two accessor (get) methods that return the values of the data members: getRbi and getBattingAverage. 5. Two mutator methods: 5.1. setRbi that receives a whole number and writes it to the rbi data member. 5.2. setBattingAverage that receives a real number and writes it to the battingAverage data member. 6. showAll accessor method that displays the values of both data members as shown here for an arbitrary test case for a player who has 10 rbi and batting average 0.1234: rbi = 10 batting average = 123 Note that the battingAverage variable will be a floating point number (double), but it must be rounded and display as a digit integer. Pitcher class requirements: 1. Pitcher class must be derived from Player class. 2. Create with separate header (Pitcher.h) and implementation (Pitcher.cpp) files. 3. One private data member, era. 4. A parameterized constructor that receives and sets the initial values for all three data members, rbi, battingAverage and era. 5. getEra accessor method that returns the value of era. 6. setEra mutator method that receives a real number and writes it to the era data member. 7. showAll function to over-ride the base class’s showAll function and do the following: call the base class’s showAll function to display the inherited data members’ values and, in addition, output the additional value, the pitcher’s era, as shown for an arbitrary test case for a pitcher who has 10 rbi, batting average 0.1234 and era of 3.456: rbi = 10 batting average = 123 era = 3.46 Note that the era variable will be a floating point number (double), but it must be rounded and display to decimal places. BaseballPlayerDriver class requirements: 1. Tell the user you’re creating a Pitcher with 10 rbi, batting average 0.1234 and era 3.456. 2. Use the parameterized constructor to create to instantiate a Pitcher variable, p1 with initial values 10 rbi, batting average 0.1234 and era 3.456. 3. Tell the user you’re using the get methods to display the values of the data members. 4. Use cout and the three get methods to display the values. 5. Tell the user you’re using the showAll method to display the values of the data members. 6. Call the showAll method. 7. Tell the user you’re using setRbi to change it to 9. 8. Use setRbi to change it to 9. 9. Use showAll to display the data values. 10. Tell the user you’re using setBattingAverage to change it to 0.2345. 11. Use setBattingAverage to change it to 0.2345. 12. Use showAll to display the data values. 13. Tell the user you’re using setEra to change it to 5.678. 14. Use setEra to change it to 5.678. 15. Use showAll to display the data values. Additional Requirement: Use the const modifier for member functions that do not write to a data member to guarantee the data members are protected. Report Put all five files   

«VPNEW»

Unlock your academic potential with Vintage-paper.com! Place your essay order today and experience top-notch writing services that guarantee academic success. Our expert writers are ready to craft customized papers that will exceed your expectations.Don't wait, order now and elevate your grades

Order Now

Basic features

  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support

On-demand options

  • Writer's samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading

Paper format

  • 275 words per page
  • 12pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, CHicago/Turabian, Havard)

Guaranteed originality

We guarantee 0% plagiarism! Our orders are custom made from scratch. Our team is dedicated to providing you academic papers with zero traces of plagiarism.

Affordable prices

We know how hard it is to pay the bills while being in college, which is why our rates are extremely affordable and within your budget. You will not find any other company that provides the same quality of work for such affordable prices.

Best experts

Our writer are the crème de la crème of the essay writing industry. They are highly qualified in their field of expertise and have extensive experience when it comes to research papers, term essays or any other academic assignment that you may be given!

Calculate the price of your order

You will get a personal manager and a discount.
We'll send you the first draft for approval by at
Total price:
$0.00

Expert paper writers are just a few clicks away

Place an order in 3 easy steps. Takes less than 5 mins.