-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHouse.cpp
39 lines (33 loc) · 950 Bytes
/
House.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//
// Created by cartofiprajiti on 14.04.2023.
//
#include "House.h"
House::~House() = default;
void House::read(const std::shared_ptr<Building>& b) {
Building::read(b);
std::cout<<"House owner name: "; getline(std::cin, owner);;
std::cout<<"\n";
}
void House::print() const{
std::cout<<"HOUSE:\n\n";
Building::print();
std::cout<<"House owner name: "; std::cout<<owner<<"\n\n";
std::cout<<"House color: "; std::cout<<getColor()<<"\n\n";
}
void House::generateColour() {
srand(time(nullptr));
color = Colors(rand()%9);
}
const char* House::getColor() const {
switch(color){
case red: return "red";
case green: return "green";
case blue: return "blue";
case yellow: return "yellow";
case white: return "white";
case brown: return "brown";
case pink: return "pink";
case orange: return "orange";
case purple: return "purple";
}
}