classes and inheritance, aggregation and composition

closed account (y8kGNwbp)
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).
Nice list.
Your code? We don't do homework, Show some effort and we can help out.
closed account (y8kGNwbp)
#include<iostream.h>

class PropertyPortal
public:
+getPropertyInfo {};

private:
int NoOfUsers() {}
void display(name) {cout<<"VU Real-Estate";}
void display(UAN) {cout<<"UAN 111-111-111";}

class PropertyType
public:

class Commercial
public:

class Residential
public:
closed account (y8kGNwbp)

#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);
void setName(char i);
int getNoOfUser();
int getUAN();
int getName();
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();
};


}
great work broo
Topic archived. No new replies allowed.