Description
Object Oriented Programming 2 – MSC1052
Topic covered: Programming assignment that involves const member function, friend function, composition, friend functions and this pointer
1 Define a class FullName and Player with the following specification
FullName
-FirstName:string
-MiddleName:string
-LastName:string
<<constructor>>+FullName()
<<destrctor>>+FullName()
+setFirstName(string)
+getFirstName():string
+setMiddleName(string)
+getMiddleName():string
+setLastName(string)
+getLastName():string
Player
-Player_ID:string
-Player_Name:FullName
-Matches_Played:int
-Goals_Scored:int
<<constructor>>+Player()
<<destructor>>+Player()
+setPlayer_ID(string)
+getPlayer_ID():string
+setMatches_Played(int)
+getMatches_Played():int
+setGoals_Scored(int)
+getGoals_Scored():int
+setPlayer_Name(Fullname)
+getPlayer_Name()
<<friend>>+Increase_GoalsScored(Player ,int )
Special Note : In class diagram + for public, – for private
Increase_GoalsScored( int ) is friend function for Player: This function will increase Goal_scored by some int every time when called.
Write C++ create object pointer(through new) to Class Player and menu driven program to
1. add player details (allocate memory for object and get player details) ,
2. display player details,
3. increase player goal scored
4. delete player from memory
Student has to upload assignment within 1.5 hours of laboratory time.




Reviews
There are no reviews yet.