-
Notifications
You must be signed in to change notification settings - Fork 0
/
customer.cpp
87 lines (80 loc) · 2.28 KB
/
customer.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
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
81
82
83
84
85
86
/// customer
#include <iostream>
#include <fstream> // for file handling
#include <sstream> // for string tokenizing
#include<iomanip>
using namespace std;
void Menu4()
{
system("CLS");
cout<<" ||****************************|| "<<endl;
cout<<" ||----------------------------||"<<endl;
cout<<" || WELCOME TO YOUR E-PHARMACY ||"<<endl;
cout<<" ||----------------------------||"<<endl;
cout<<" ||****************************||"<<endl;
cout<<endl;
cout<<" *******************************"<<endl;
cout<<" -------------------------------"<<endl;
cout<<" Press 1 for medicine details. "<<endl;
cout<<" Press 2 for buying medicines. "<<endl;
cout<<" -------------------------------"<<endl;
cout<<" *******************************"<<endl;
}
int main()
{
Menu4();
int choice = 0;
int choice2= 0;
if(choice == 1 )
{
displayallMedicines();
}
else if(choice== 2)
{
do
{
system("CLS");
displayallMedicines();
cout<<" Again Press 2 for buying medicine : "
cin>>choice2;
}
while( choice2== 2)
{
system("CLS");
string cname;
int cquantity;
string cpaidAmount;
cout<<" Enter details for the medicine to buy : "<<endl;
cout<<" -------------------------------------- "<<endl;
cout<<endl;
cout<<" Enter your name : ";
cin>>cname;
cout<<endl;
cout<<" Enter medicine name : ";
cin>>medicineName;
cout<<endl;
cout<<" Enter quantity : ";
cin>>cquantity;
system("CLS");
float total= cquantity*price;
cout<<" Total bill is : "<<total;
cout<<endl;
cout<<" Enter paid amount : ";
cin>>cpaidAmount;
cout<<endl;
total=total-cpaidAmount;
cout<<" Change is : "<<total<<endl;
cout<<" _____________________________________"<<endl;
cout<<" _____________________________________"<<endl;
cout<<"|| ||"<<endl;
cout<<"|| *** THANK YOU FOR VISITING *** ||"<<endl;
cout<<"|| ||"<<endl;
cout<<" _____________________________________"<<endl;
cout<<" _____________________________________"<<endl;
}
}
else
{
cout<<" ******* INCORRECT OPTION ******* "<<endl;
}
}