Untitled

mail@pastecode.io avatar
unknown
plain_text
20 days ago
813 B
4
Indexable
Never
#pragma once
#include <iostream>
#include "string"
using namespace std;

class Book{
    int ISBNno;
    string name;
    string author;
    float cost;
    int status;

public:
    Book(int ISBNno,string name,string author,float cost,int status);

    int getISBNno(void)const;
    string getAuthorname(void)const;
    string getBookname(void)const;
    float getcost(void)const;
    void setcost(float cost);
    int getstatus(void)const;

    void Lend();
    void Return();
    void Lost();
    void bookdetails()const;


};above is.h
#include "book.h"
#include <iostream>
#include <string>
using namespace std;

int main(){
    Book book(101,"c program","Denis",300,0);

    book.bookdetails();

    book.Lend();

    book.Lend();
    book.Return();

    book.Lost();

    cout<<book.getAuthorname()<<endl;
}
Leave a Comment