-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBook.cpp
More file actions
52 lines (44 loc) · 1.2 KB
/
Book.cpp
File metadata and controls
52 lines (44 loc) · 1.2 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
#include <iostream>
#include <string>
using namespace std;
int main(){
int points = 0;
int choice;
while (true)
{
cout<<"\n Book Store Reward Program \n";
cout<<"1.Make a Purchase: \n";
cout<<"2.Check Points \n";
cout <<"3.Claim a Discount: \n";
cout<<"4.Exit \n";
cout<<"Enter choice: ";
cin>> choice;
if (choice == 1)
{
points += 10;
cout<<"Book Purcahse you have erned 10 points. Total points \n"<< points<< endl;
}else if (choice == 2)
{
cout<<"you have: "<< points <<" points: \n";
}else if (choice == 3)
{
if (points >= 20)
{
cout<<"Discount Claimed! point reset to 0. \n";
points = 0;
}else
{
cout<<"Not Engough points to calimed Discount \n";
}
}
else if (choice == 4)
{
cout<<"Thnk you for Existing... \n";
break;
}
else
{
cout<<"invalid Choice try again.... ";
}
}
}