Skip to content

Commit ec7bd53

Browse files
bookclass.cpp
A book information container object created using class.
1 parent d8ff197 commit ec7bd53

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

bookclass.cpp

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#include<iostream>
2+
using namespace std;
3+
class BOOKX {
4+
private:
5+
char book_name;
6+
char book_author;
7+
int book_price;
8+
int book_edition;
9+
public:
10+
void input() {
11+
cout<<"Book name:";
12+
cin>>book_name;
13+
cout<<endl;
14+
cout<<"Book author:";
15+
cin>>book_author;
16+
cout<<endl;
17+
cout<<"Book price:";
18+
cin>>book_price;
19+
cout<<endl;
20+
cout<<"book edition:";
21+
cin>>book_edition;
22+
cout<<endl;
23+
}
24+
void output() {
25+
cout<<"Book name"<<book_name<<"Author"<<book_author<<"price"<<book_price<<"edition"<<book_edition;
26+
}
27+
};
28+
int main() {
29+
BOOKX a;
30+
a.input();
31+
a.output();
32+
return 0;
33+
}

0 commit comments

Comments
 (0)