-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReader.cpp
More file actions
80 lines (64 loc) · 1.58 KB
/
Reader.cpp
File metadata and controls
80 lines (64 loc) · 1.58 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#include <iostream>
#include <string>
#include <locale>
using namespace std;
class Reader {
private:
string fullName;
int cardNumber;
string faculty;
string birthDate;
string phone;
public:
Reader(string name, int card, string fac, string birth, string ph) {
fullName = name;
cardNumber = card;
faculty = fac;
birthDate = birth;
phone = ph;
}
void takeBook(int count) {
cout << fullName << " âçÿë " << count << " êíèãè." << endl;
}
void returnBook(int count) {
cout << fullName << " âåðíóë " << count << " êíèãè." << endl;
}
};
class Book {
private:
string author;
string title;
int year;
public:
void setAuthor(string book_author) {
author = book_author;
}
void setTitle(string book_title) {
title = book_title;
}
void setYear(int book_year) {
year = book_year;
}
string getAuthor() {
return author;
}
string getTitle() {
return title;
}
int getYear() {
return year;
}
};
int main() {
setlocale(LC_ALL, "RUS");
const int numReaders = 2;
Reader readers[numReaders] = {
Reader("Èâàíîâ Èâàí Èâàíîâè÷", 123456, "Ïðèêëàäíàÿ èíôîðìàòèêà", "01.01.2004", "+79601234567"),
Reader("Ïåòðîâ Ïåòð Ïåòðîâè÷", 654321, "Ñòðîèòåëüíûé", "15.05.2003", "+79105876543")
};
for (int i = 0; i < numReaders; ++i) {
readers[i].takeBook(3);
readers[i].returnBook(2);
}
return 0;
}