consolidate all repos to one for archive
This commit is contained in:
27
semester_2/programiranje_2/primeri/Example11/House.h
Normal file
27
semester_2/programiranje_2/primeri/Example11/House.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef EXAMPLE11_HOUSE_H
|
||||
#define EXAMPLE11_HOUSE_H
|
||||
|
||||
#include <iostream>
|
||||
#include "Room.h"
|
||||
|
||||
class House {
|
||||
private:
|
||||
std::string name;
|
||||
Room kitchen, livingRoom, bedroom; //composition
|
||||
public:
|
||||
House(std::string name) : name(name), kitchen("Kitchen1"), livingRoom("living room 1"),
|
||||
bedroom("TV bedroom") {
|
||||
std::cout << "House::constructor" << std::endl;
|
||||
}
|
||||
virtual ~House() {
|
||||
std::cout << "House::destructor" << std::endl;
|
||||
}
|
||||
virtual void print() const {
|
||||
std::cout << "House name: " << name << std::endl;
|
||||
kitchen.print();
|
||||
livingRoom.print();
|
||||
bedroom.print();
|
||||
}
|
||||
};
|
||||
|
||||
#endif //EXAMPLE11_HOUSE_H
|
||||
Reference in New Issue
Block a user