Question: In C++ please Design a class that represents a major-league baseball player. the player' class should have (at the very least) data members: name, team,

 In C++ please Design a class that represents a major-league baseballIn C++ please

Design a class that represents a major-league baseball player. the "player' class should have (at the very least) data members: name, team, height, weight, age, and batting Average. Provide a constructor that takes some, or all of these parameters as arguments (I recommend initializing batting Average to zero.) the class should have members Get Profile () (to print out all the player s information), and Add Batting Data (), that adds batting information, and updates the batting Average data member. We will define batting average as: Batting Average = (number Of Hitsumber Of Times at Bat) Write a program that instantiates a player object (either hard-code the player's information, or prompt the user for it.) Loop N-times (where N = number of at-bats, user supplied) to add batting information (i.e. each time through the loop ask: "Hit? (y): '), and finally print out the player profile with the updated batting average. Make sure you keep/update the batting average information using member variable

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!