12-30-2010, 07:08 PM
Deadline
Your assignment must be uploaded before or on 4tht January, 2011
Rules for Making
It should be clear that your assignment will not get any credit if:
[FONT="] [/FONT]
[FONT="]o [/FONT]The assignment is submitted after due date
[FONT="]o [/FONT]The assignment is copied
[FONT="]Objectives[/FONT]
This assignment has been designed so that you would be able to implement the concept of composition in OOP. After the completion of this assignment you should have a good grasp on how to
[FONT="]o [/FONT]Inheritance
[FONT="]o [/FONT]Public & private inheritance
[FONT="]o [/FONT]Using basic constructs of OOP in a program
Assignment
You have to write a C++ Program in which you will have to write a class ‘Pakistani Citizens’ which has five data members “name, age, CNIC No, province, and domicile” and two data functions getter and setter for each data member e.g setAge() getAge() etc.
Write a second class ‘VotersList’ which inherited the ‘PakistaniCitizens’ class and has “implemented in term of” relationship to pakistaniCitizens.
The ‘VotersList’ class restrict the functionality of setAge() function by override the setAge() function of ‘PakistaniCitizens’ class and check the condition :
If age is greater than 18 then print “Eligible for vote cast”.
If object of VotersList class is initialized with the age less than 18, then it prints a message
“Age is less than 18” and sets the value of age to default.
Your assignment must be uploaded before or on 4tht January, 2011
Rules for Making
It should be clear that your assignment will not get any credit if:
[FONT="] [/FONT]
[FONT="]o [/FONT]The assignment is submitted after due date
[FONT="]o [/FONT]The assignment is copied
[FONT="]Objectives[/FONT]
This assignment has been designed so that you would be able to implement the concept of composition in OOP. After the completion of this assignment you should have a good grasp on how to
[FONT="]o [/FONT]Inheritance
[FONT="]o [/FONT]Public & private inheritance
[FONT="]o [/FONT]Using basic constructs of OOP in a program
Assignment
You have to write a C++ Program in which you will have to write a class ‘Pakistani Citizens’ which has five data members “name, age, CNIC No, province, and domicile” and two data functions getter and setter for each data member e.g setAge() getAge() etc.
Write a second class ‘VotersList’ which inherited the ‘PakistaniCitizens’ class and has “implemented in term of” relationship to pakistaniCitizens.
The ‘VotersList’ class restrict the functionality of setAge() function by override the setAge() function of ‘PakistaniCitizens’ class and check the condition :
If age is greater than 18 then print “Eligible for vote cast”.
If object of VotersList class is initialized with the age less than 18, then it prints a message
“Age is less than 18” and sets the value of age to default.

mileys18: