Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.

Object Oriented Programming (CS304)

Assignment No.2



Your assignment must be uploaded before or on 29th November, 2012


Rules for Marking

It should be clear that your assignment will not get any credit if:


  • The assignment is submitted after due date.
  • Make sure your assignment solution is not copy pasted or modified from any source such as website, other students, groups, forums etc. Zero will be awarded straightaway and no further request will be entertained in this regard in any case. We may be lenient while giving attempts marks but no relaxation will be given for copied or modified assignments.
  • The assignment submitted in a format other than .cpp.




The objectives of this assignment are, giving the idea of practical implementation of basic object oriented concepts like:

  • Composition
  • Aggregation






















You are required to provide a practical implementation in C++ for the following class diagram. You have to provide the solution in the form of classes in C++.



Class Diagram for Assignment No. 2


Figure 1: Object Model of Property Portal



Detail Description:

You are required to give C++ implementation of following classes:


  1. 1.      PropertyPortal
  2. 2.      PropertyType
  3. 3.      Commercial
  4. 4.      Residential


Following is the description of all data member and member functions of respective classes:


v     Data members for PropertyPortal:


  • NoOFUsers: This data member will be used to know the total number of users which visited this site/portal.
  • Name: Property portal will have some name; you can name it as VU-Real-Estate. 
  • UAN: Property portal will have some universal access number such as 111-111-111. 


v     Methods for PropertyPortal:

  • Constructor(s) and destructor.
  • Setter and getter function for NoOFUsers, Name, and UAN data members.
  • getPropertyInfo() will take information about property type, property belongs to which city and all other details which are available in PropertyType class.


v     Data members for PropertyType:

  • City: User will input city in which he/she want to search property details.


v     Methods for PropertyType:

  • Constructor(s) and destructor for class.
  • Setter and getter function for city data member.
  • getPropertyType() will ensure whether property is a commercial property or it is a residential property. A property can’t be both at same time.


v     Data members for Commercial

  • PropertyValue: Will show some fixed value for the commercial property.


v     Methods for Commercial

  • Constructor(s) and destructor for class.
  • Setter and getter function for PropertyValue data member.
  • getPlot() will return a plot number.


v     Data members for Residential

  • PropertyValue:  Will show some fixed value for the Residential property.


v     Methods for Residential

  • Constructor(s) and destructor for class.
  • Setter and getter function for propertyValue data member.
  • getPropertyCategory() This method will check for property category if it is a plot then it will return true else will print an appropriate message.  


Important Points:


  1. You also have to show the relationship (inheritance, association, aggregation, composition) between classes in proper C++ syntax with comments. No marks will be given for incorrect relationship.
  2. Dynamically allocate memory where required.
  3. Implement all member functions of each class. Make sure you use most appropriate return types and signatures for the function.  
  4. Implement constructors of all classes (Overload constructors if required also can use copy constructor if required).



Note: You are required to submit only .cpp file. Word document or any other file format will award you 0 marks straight away.

Views: 17959


Replies to This Discussion

yar koi to reply krien assignment solution ab srif kuch he hour baqi hain data expaire hony mein

5hours left yaar, Kisi ne bana li hui hai to please send kr do Changing mein bhi Time lagta hai yaar Koi to Help kro.. 

Dosto ya tau confirm kr do k ya relations theak hn............?

 PropertyPortal(); //agregation realtionship with propertyType

class propertyType //PropertyType class

class Commercial:PropertyType    // Commercial Class have composition relationship with propertyType

class residential:PropertyType  //Residentail Class have composition relationship with propertyType


yaar pehly yeh confirm karo kay is program ka output kya ay ga

basically is ka koi output require nhi so ..just associations bnao..

you have solution than share it

koi to kar do solution post

assignment ka output ay ga kya yaar yeh to bato

:( final solution ??

ya hamen bhe btao na

kabhi kisi Assignment ne itna wait nahin krwaya yaar.. 

final solution yeh hoga just message show krna hai prototype ka "This is just a prototype of all classes"


Looking For Something? Search Below

Latest Activity

Profile IconMuhammad Kasim and shahzad Hussain joined Virtual University of Pakistan
39 minutes ago
Mr Siren Head replied to Hania Khalid Shariff's discussion zero semester
3 hours ago
Hania Khalid Shariff and Huma Ahmad are now friends
12 hours ago
Huma Ahmad liked Hania Khalid Shariff's profile
13 hours ago
BBA(6th smes) left a comment for Rimsha mujahid
14 hours ago
Rimsha mujahid replied to + Audit Officer's discussion Accounts first smester
14 hours ago
Umar Farooq is now a member of Virtual University of Pakistan
Hania Khalid Shariff liked ▌general♥'s discussion Passing Criteria for VU Students (Simple & Easy)

VIP Member Badge & Others

How to Get This Badge at Your Profile DP


Management: Admins ::: Moderators

Other Awards Badges List Moderators Group

© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service