-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFilm.cpp
More file actions
66 lines (56 loc) · 1.41 KB
/
Film.cpp
File metadata and controls
66 lines (56 loc) · 1.41 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
#include "Film.h";
#include <string>
#include <iostream>
Film::Film() {
name = "Null";
genre = "Null";
ratting = 0;
price = 0;
}
void Film::SetFilm(string name_value, string genre_value, float ratting_value, int price_value) {
name = name_value;
genre = genre_value;
ratting = ratting_value;
price = price_value;
}
string Film::GetName() {
return name;
}
string Film:: GetGenre() {
return genre;
}
float Film::GetRatting() {
return ratting;
}
int Film::GetPrice() {
return price;
}
void Film:: ScanFilm() {
setlocale(LC_CTYPE, "Russian");
cout << "ÍÎÂÛÉ ÔÈËÜÌ" << endl << "Ââåäèòå äàííûõ î ôèëüìå" << endl;
cout << "Íàçâàíèå:" << endl;
cin >> name;
cout << "Æàíð:" << endl;
cin >> genre;
cout << "Ðýéòèíã:" << endl;
cin >> ratting;
cout << "Öåíó çà áèëåò:" << endl;
cin >> price;
};
void Film::Print() {
setlocale(LC_CTYPE, "Russian");
cout << "Íàçâàíèå: " << name << "\t Æàíð: " << genre << "\t Ðýéòèíã: " << ratting << "\t Öåíà: " << price << endl;
}
void Film::Putinfile(string filename) {
ofstream file;
file.open(filename, ios_base::app);
if (!file) {
cout << "Îøèáêà ðàáîòû ñ ôàéëîì" << endl;
return;
}
file << name << " ";
file << genre << " ";
file << ratting << " ";
file << price << " " << endl;
file.close();
}