Sponsored links

Sunday 19 May 2013

CS304 Object Oriented Programming Assignment 2 Solution Spring 19th May 2013


Composition and Aggregation is an important relationship between objects in object oriented paradigm. Consider the following class diagram, which shows some classes and their relationship (Composition and Aggregation), while the detail of classes is given in the table.
Class NameAttribute NameAttribute Data TypeFunctions
SignNameCharacter String-Constructor
   -Getters and Setters
CandidateNameCharacter String-Default constructor()
 Votes_obtainInteger-Overloaded Constructor
 signSign-Getters and Setters
   -Count_votes()
ConstituencyConNoCharacter String-Default constructor()
 Candidate_nameCadidate-Overloaded Constructor
   -Getters and Setters
ResultDayOf_resultCharacter String-Default constructor
   -Getters and Setters
   -compile_result()
VB_PaperCanNameCandidate-Default constructor
 resResult-Overloaded Constructor
   -Getters and Setter
   -Get_result()

You are required to implement this class diagram (Write complete program) in to C++ with all functions and concepts (Aggregation and composition) given in the class diagram/table.
You need to consider that there may be two or more than two candidates who can contest in the constituency.

Details of important Member functions:
Count_votes(): This function will count votes of each candidate.
compile_result() : This function will Compile (calculate) the result of the contesting candidates.
Get_result(): This function will get/show result from the Result class through the part object “res” of the VB_Paper class.


No comments:

Post a Comment