Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CS304 Object Oriented Programming Assignment No.2 Fall Semester 2012
#1





CS304 Object Oriented Programming Assignment No.2 Fall Semester 2012


Object Oriented Programming (CS304)
Assignment No.2

Deadline
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:

o The assignment is submitted after due date.
o 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.
o The assignment submitted in a format other than .cpp.


Objectives
The objectives of this assignment are, giving the idea of practical implementation of basic object oriented concepts like:
o Composition
o 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:

 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.

 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.

 Data members for PropertyType:
o City: User will input city in which he/she want to search property details.

 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.

 Data members for Commercial
o PropertyValue: Will show some fixed value for the commercial property.

 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.

 Data members for Residential
o PropertyValue: Will show some fixed value for the Residential property.

 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:

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.


Attached Files
.doc   Fall2012_CS304_2.doc (Size: 91 KB / Downloads: 189)

0300-9520262
Get solution in 24 hour
|cpmputer & internetConfusedmileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
Reply
#2
[SIZE="3"]Idea Solution :[/SIZE]

#Include<iostream.h>
main(void)
{
class PropertyPortal
{
private:
int NoOfUsers;
char *UAN;
char *Name;
public:

void setNoOfUser(int No); // setting the day
void setUAN(char Uan); // setting the month
void setName(char Name); // setting the year
int getNoOfUser(); // getting the value of day
int getUAN(); // getting the value of month
int getName(); // getting the value of year
int getPropertyInfo();
// Constructors of the class
PropertyPortal();
PropertyPortal (int, char);
PropertyPortal(int, char, char);
// Destructor of the class
~PropertyPortal ();
// hidden part of the class


void setNoOfUser(int i)
{
NoOfUsers=i;
}

void setUAN(char i)
{

}
PropertyPortal()
{
NoOfUsers=0;
UAN=NULL;
Name=NULL;
}

PropertyPortal (int No, char* Uan)
{
NoOfUsers=No;
UAN=Uan
Name=VU-Real-Estate;
}

PropertyPortal(int No, char* Uan, char* Name)
{
NoOfUsers=No;
UAN=Uan
Name=Name;
}
void setNoOfUser(int i)

void setUAN(char i); // setting the month
void setName(char i); // setting the year
int getNoOfUser(); // getting the value of day
int getUAN(); // getting the value of month
int getName(); // getting the value of year
int getPropertyInfo();

};

class PropertyType
{
private:
char *City;

public:
void setCity(char a); // setting the City
int getCity(char a);//get the city
void GetPropertyType();
PropertyType();
PropertyType(char);
~PropertyType();
PropertyType()
{
city=NULL;
}
PropertyType(char* acity)
{
City=acity
}


};

class Commercial:public PropertyType
{

private:
int PropertyValue;
public:
void GetPlot();
void setPropertyValue();
int getPropertyValue();
Commercial();
Commercial(char);
~Commercial();
};

class Residential:public PropertyType
{

private:
int PropertyValue;
public:
void GetPropertyCatagory();
void setPropertyCatagory();
Residential();
Residential(int);
~Residential();
};


}

0300-9520262
Get solution in 24 hour
|cpmputer & internetConfusedmileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  CS301 Assignment # 4 Due Date: 02-Feb-2016 Vuhelper 0 2,319 02-03-2016, 05:38 PM
Last Post: Vuhelper
  CS703 – Advanced Operating Systems Assignment No.3 solution January 2016 Vuhelper 0 5,904 01-23-2016, 09:58 PM
Last Post: Vuhelper
  CS601 Data Communication Assignment No. 03 Solution 23rd January 2016 Vuhelper 1 1,924 01-23-2016, 06:09 PM
Last Post: Vuhelper
  CS403 Assignment No. 03 Solution 23rd January 2016 Vuhelper 2 1,159 01-23-2016, 03:18 PM
Last Post: Vuhelper
  CS506 Web Design and Development Assignment no 3 Solution 3rd January 2016 Vuhelper 0 2,237 01-23-2016, 03:16 PM
Last Post: Vuhelper
  CS724 Software Process Improvement Assignment No 01 Solution 20th January 2016 Vuhelper 0 1,962 01-20-2016, 06:26 PM
Last Post: Vuhelper
  CS711 Software Design Assignment No 01 Solution Due Date Feb 12, 2016 Vuhelper 0 1,658 01-20-2016, 06:24 PM
Last Post: Vuhelper
  CS709 Formal Methods for Software Engineering Assignment No 01 Solution January 2016 Vuhelper 0 1,792 01-20-2016, 06:22 PM
Last Post: Vuhelper
  cs703 assignment no 3 Solution 20th January 2016 Vuhelper 0 1,695 01-20-2016, 06:20 PM
Last Post: Vuhelper
  CS704 Assignment No. 01 Solution January 2016 Vuhelper 0 4,794 01-20-2016, 06:19 PM
Last Post: Vuhelper

Forum Jump:


Users browsing this thread: 1 Guest(s)