Tuesday, July 28, 2009

Write a C++ program that implements the given class hierarchy.:?

Your program should consists of three classes


1-Player


This class contains two data members


i.Name//for player’s name


ii.Matches//for number of matches player played


The Player class should contain a member function named Display() which is meant to display the data members values on the screen. This method should be virtual in this particular and in all the subsequent classes.


2-Batsman


This class should contain the following data members





i.Total_score//for total scores a Batsman scored


ii.Per_match_score[ ] //for per match score, the array size should equal to the number of matches a Batsman/Player played


iii.Average//for score’s average





This class should also contain two member functions. One of which named Calculate_Avg () which is meant to calculate average scores of batsman. It should also contain another member function named Display() which is meant to display the information of Batsman. Before displaying the data members of Batsman, it shd dispaly

Write a C++ program that implements the given class hierarchy.:?
"Write a C++ program" seems to be a kind of a command rather than a question. If you need help with your homework, try at least to be more or less polite.
Reply:Do your own homework.
Reply:where is your effort?





no one is going to do your homework for you. this is a very simple assignment if you would actually read the book.


No comments:

Post a Comment