- Back to Home »
- cs304 Assignment no 2 fall 2012 Idea Solution
Posted by : Anonymous
Tuesday, 27 November 2012
Objectives
The
objectives of this assignment are, giving the idea of practical implementation of
basic object oriented concepts like:
- Composition
- Aggregation
Assignment:
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.
PropertyPortal
2.
PropertyType
3.
Commercial
4.
Residential
Following
is the description of all data member and member functions of respective
classes:
v
Data members for
PropertyPortal:
o
NoOFUsers: This data member will be used to
know the total number of users which visited this site/portal.
o
Name: Property portal will have some name;
you can name it as VU-Real-Estate.
o
UAN: Property portal will have some
universal access number such as 111-111-111.
v
Methods for
PropertyPortal:
o
Constructor(s)
and destructor.
o Setter and getter function for NoOFUsers, Name, and UAN data members.
o 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:
o City:
User will input
city in which he/she want to search property details.
v
Methods for PropertyType:
o
Constructor(s)
and destructor for class.
o Setter and getter function for city data member.
o 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
o
PropertyValue: Will show some fixed value for the
commercial property.
v
Methods for Commercial
o
Constructor(s)
and destructor for class.
o Setter and getter function for PropertyValue data member.
o
getPlot() will return a plot number.
v
Data members for
Residential
o
PropertyValue: Will
show some fixed value for the Residential property.
v
Methods for Residential
o
Constructor(s)
and destructor for class.
o Setter and getter function for propertyValue data member.
o
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:
- 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.
- Dynamically allocate memory where required.
- Implement all member functions of each class. Make sure you use most appropriate return types and signatures for the function.
- 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.