fork download
#include
#include
using namespace std;

class House{
private:
    string *nameowner;
    int *numroom;
	int *Rentingfee;
	Room *room;
	friend class Town;
public:
House(){
    	setnameowner();
		setnumroom();
		Rentingfee=new int(0);}
		
	
	~House(){
		cout<<"bye House"<>a;
	   nameowner=new string(a);}

	 const string *getnameowner() const{
		 return nameowner;}

	void setnumroom(){
		int b;
		cout<<"Enter the rooms number of this house:";
		cin>>b;
		numroom=new int(b);
		setRoom(b);
	}

	const int *getnumroom()const{
		return numroom;}


	void setRoom(int n){
		room=new Room[n];}

	void setRentingFee(int index){
		int m;
		cout<<"Enter the monthly Renting fee of this house:";
		cin>>m;
		Rentingfee=new int(m);
	}

	const int *getRentingFee()const{
		return Rentingfee;
	}

	void DisplayHouse(){
		cout<<"the house name is :"<>n;
			NameTown=new string(n);}



    const string *getNameTown() const{
		return NameTown;}

	 int getNum(){
		 return Num;}

	void sethomes(){
		 homes=new House[5];}


	void Addhouse(House a ,int index){
		homes[index]=a;
setRented(index);
if( Rented[index]=1)
	homes[index]. setRentingFee(index);
else
	cout<<"No Rening fee"<>a;
	   if(a){
		   Rented[index]=1;
		   cout<<"this house is rented"<*(homes[i].Rentingfee)){
				mini=*(homes[i].Rentingfee);
				name=*(homes[i].nameowner);}
			
			cout<<"the least renting fee is "<>a;
		Area=a;}

	int getArea(){
		return Area;}

	void setroomname(string n){
		cout<<"Enter the name of this room ";
		cin>>n;
		roomname=n;}

	string getnameroom(){
		return roomname;}

	void DisplayRoom(){
		cout<<"name of room :"<<&getnameroom<
				
				
				
				
				
				
			
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:10: error: ISO C++ forbids declaration of ‘Room’ with no type
prog.cpp:10: error: expected ‘;’ before ‘*’ token
prog.cpp: In destructor ‘House::~House()’:
prog.cpp:21: error: ‘room’ was not declared in this scope
prog.cpp: In member function ‘void House::setRoom(int)’:
prog.cpp:47: error: ‘room’ was not declared in this scope
prog.cpp:47: error: expected type-specifier before ‘Room’
prog.cpp:47: error: expected `;' before ‘Room’
prog.cpp: In member function ‘void House::DisplayHouse()’:
prog.cpp:66: error: ‘room’ was not declared in this scope
prog.cpp: At global scope:
prog.cpp:210: error: expected `}' at end of input
prog.cpp: In constructor ‘Town::Town(std::string)’:
prog.cpp:85: error: no matching function for call to ‘Town::Town()’
prog.cpp:77: note: candidates are: Town::Town(std::string)
prog.cpp:69: note:                 Town::Town(const Town&)
prog.cpp: In member function ‘void Town::Addhouse(House, int)’:
prog.cpp:110: warning: suggest parentheses around assignment used as truth value
prog.cpp: In member function ‘void Town::HomeArea(int)’:
prog.cpp:157: error: ‘class House’ has no member named ‘room’
prog.cpp: In member function ‘void Town::DisplayTowm()’:
prog.cpp:162: error: ISO C++ forbids taking the address of an unqualified or parenthesized non-static member function to form a pointer to member function.  Say ‘&Town::getNameTown’
prog.cpp: In member function ‘void Town::Room::DisplayRoom()’:
prog.cpp:203: error: ISO C++ forbids taking the address of an unqualified or parenthesized non-static member function to form a pointer to member function.  Say ‘&Town::Room::getnameroom’
prog.cpp:204: error: ISO C++ forbids taking the address of an unqualified or parenthesized non-static member function to form a pointer to member function.  Say ‘&Town::Room::getArea’
prog.cpp: At global scope:
prog.cpp:210: error: expected unqualified-id at end of input
stdout

Standard output is empty