-
Notifications
You must be signed in to change notification settings - Fork 0
/
lib.cpp
120 lines (103 loc) · 2.5 KB
/
lib.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#include <iostream>
using namespace std;
class libz
{
string isbn, ttle, author, edition, publication;
public:
void setting(string isbn, string author, string ttle, string edition, string publication)
{
this->author = author;
this->ttle = ttle;
this->edition = edition;
this->isbn = isbn;
this->publication = publication;
}
void getisbn(string a)
{
isbn = a;
}
void getTtle(string t) { ttle = t; }
void getAthore(string aut) { author = aut; }
void getedit(string ed) { edition = ed; }
void getpublication(string pub) { publication = pub; }
};
class Bookz : public libz
{
public:
static void addbook(int counter)
{
string isbn, ttle, author, edition, publication;
cout<<"add";
if(counter<10)
{
cout<<"enter isbn";
getline(cin,isbn);
cout<<"enter ttle";
getline(cin,ttle);
cout<<"enter author";
getline(cin,author);
cout<<"enter edition";
getline(cin,edition);
cout<<"enter publication";
getline(cin,publication);
cout<<"book added"<<endl;
cout<<"press any key to continue ..."<<endl;
}
else
{
cout<<"you have reached to max to added :"<<endl;
cout<<"press any to continue :"<<endl;
}
};
void delbook(int counter);
void searchbook();
void editbook();
void viewallbook();
void quit();
};
int main()
{
Bookz b1[20];
int ch, counter = 0;
cout << "management :" << endl;
cout << "add book : 1" << endl;
cout << "2 del book : 1" << endl;
cout << "3 edit : 1" << endl;
cout << "4 search book : 1" << endl;
cout << "5 view all books book : 1" << endl;
cout << "6 quit : 1" << endl;
cout << "enter choice" << endl;
cin >> ch;
cout << "ch";
for(int i=0; i<10; i++)
{
switch (ch)
{
case 1:
{
b1[i].addbook(counter);
break;
}
case 2:
b1[i].delbook(counter);
break;
case 3:
b1[i].editbook();
break;
case 4:
b1[i].searchbook();
break;
case 5:
b1[i].viewallbook();
break;
case 6:
b1[i].quit();
break;
default:
main();
break;
}
}
system("pause");
return 0;
}