-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRetailitem.cpp
More file actions
44 lines (35 loc) · 980 Bytes
/
Retailitem.cpp
File metadata and controls
44 lines (35 loc) · 980 Bytes
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
#include <iostream>
#include <string>
#include <locale>
using namespace std;
class RetailItem {
private:
string description;
int quantity_in_stock;
double price;
public:
RetailItem(string desc, int quantity, double pr) {
description = desc;
quantity_in_stock = quantity;
price = pr;
}
void display() {
cout << "Îïèñàíèå òîâàðà: " << description << endl;
cout << "Êîëè÷åñòâî åäèíèö íà ñêëàäå: " << quantity_in_stock << endl;
cout << "Öåíà: " << price << endl;
cout << endl;
}
};
int main() {
setlocale(LC_ALL, "RUS");
RetailItem item1("Ïèäæàê", 12, 59.95);
RetailItem item2("Äèçàéíåðñêèå äæèíñû", 40, 34.95);
RetailItem item3("Ðóáàøêà", 20, 24.95);
cout << "Òîâàð 1:" << endl;
item1.display();
cout << "Òîâàð 2:" << endl;
item2.display();
cout << "Òîâàð 3:" << endl;
item3.display();
return 0;
}