-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPointofSales.cpp
More file actions
67 lines (64 loc) · 1.9 KB
/
PointofSales.cpp
File metadata and controls
67 lines (64 loc) · 1.9 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
#include <iostream>
using namespace std;
struct bargains
{
string productcode;
string productname;
float price;
float count;
};
int main()
{
int input,much=0,a;
float total=0,totalsum=0,average,money,exchange;
cout << "======= === ======\n";
cout << "= = = = =\n";
cout << "= = = = =\n";
cout << "= = = = =\n";
cout << "= = = = ==\n";
cout << "===== = = ===\n";
cout << "= = = =\n";
cout << "= = = =\n";
cout << "= = = =\n";
cout << "= === ======\n";
cout << "Point Of Sales\n";
cout << endl;
cout << "How much product do you buy? ";
cin >> input;
cout << endl;
bargains data[input];
for(a=0;a<input;a++)
{
cout << "Product Code: ";
cin >> data[a].productcode;
cout << "Product Name: ";
cin >> data[a].productname;
cout << "Price : ";
cin >> data[a].price;
cout << "Count : ";
cin >> data[a].count;
cout << "=========================================\n";
much=data[a].count+much;
total=data[a].price*data[a].count+total;
totalsum=total+totalsum;
}
cout << endl;
average=totalsum/much;
cout << "Total Products = " << much << endl;
cout << "Total Bill = " << totalsum << endl;
cout << "Average Bill per Product= " << average << endl;
cout << endl;
cout << "Your money = ";
cin >> money;
exchange=money-totalsum;
if(exchange<0)
{
cout << "Kurang duitnya cuk!" << endl;
}
else
{
cout << "Your exchange= " << exchange << endl;
}
system("pause");
return 0;
}