-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspecialroom.cpp
50 lines (40 loc) · 914 Bytes
/
specialroom.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
40
41
42
43
44
45
46
47
48
49
50
#include <iostream>
#include "specialroom.h"
using namespace std;
Specialroom::Specialroom():room()
{
this->purpose=" ";
}
Specialroom::Specialroom(string purpose,string code,int floor,string name,int num):room(code,floor,name,num)
{
this->purpose=purpose;
}
Specialroom::Specialroom(Specialroom& spcopy):room(spcopy)
{
this->purpose= spcopy.purpose;
}
Specialroom::~Specialroom()
{
}
string Specialroom::get_purpose()
{
return this->purpose;
}
void Specialroom::display()
{
cout<<*this;
}
istream& Specialroom::fileInput(std::istream& is)
{
is >>name>>num>>room_code>>floor>>purpose;
return is;
}
ostream& operator <<(ostream& out, Specialroom& r1)
{
return out<<r1.name<<" "<<r1.num<<" "<<r1.room_code<<" "<<r1.floor<<" "<<r1.purpose<<endl;
}
std::istream& operator >> (std::istream & is, Specialroom *s)
{
is >> s->name>>s->num>>s->floor>>s->room_code>>s->purpose;
return is;
}