Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Liber {
- public:
- Liber() {
- }
- Liber(string title, string author, int pages, int price) {
- m_title=title;
- m_author=author;
- m_pages=pages;
- m_price=price;
- }
- string GetTitle() {
- return m_title;
- }
- string GetAuthor(){
- return m_author;
- }
- int GetPages(){
- return m_pages;
- }
- int GetPrice(){
- return m_price;
- }
- void SetTitle(string title) {
- m_title = title;
- }
- void SetAuthor(string author){
- m_author = author;
- }
- void SetPages(int pages){
- m_pages = pages;
- }
- void SetPrice(int price){
- m_price = price;
- }
- void Print(){
- cout << "Autori: " << m_author << endl;
- cout << "Titulli: " << m_title << endl;
- cout << endl << "Cmimi, faqe: " << m_price << ", " << m_pages << endl;
- }
- private:
- string m_title, m_author;
- int m_pages, m_price;
- };
- int main(){
- Liber b1("Don Quixote", "Servantes",300 , 10000);
- b1.Print();
- Liber a[5] = {
- Liber("Keshtjella", "I.Kadare", 350, 8000),
- Liber("Shtepi kukulle", "H.Ibsen", 200, 40000),
- Liber("Fabulat e Ezopit", "Ezopi",50, 5000),
- Liber("L'Inferno", "Dante", 300, 9000),
- Liber("The Art of War", "Sun Tzu", 1000, 999999) //it's over 9000!!!!!!!!!!!!!!!
- };
- for(int i=0; i<5; i++){
- a[i].Print();
- }
- cout<<endl;
- Liber *b2 = new Liber("The Way of Life", "Laozi", 500, 800000);
- b2->Print();
- //cout<<&b2;
- int b;
- cin >> b;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement