please can you help me to solve this problem :>>>

no
develop a bookstore information system. The bookstore
manages a collection of books it is selling, book orders, and customers who purchased from the store. A
book store also has a counter that accepts cash from book sales. Each book Customer can search for a
book by its ID, title, author, publisher, edition, year of publication and price. The book store also records

the number of copies available for each book. Customers  can order a book from the bookstore.    The 

bookstore needs to keep information about its customers such as customer id, first name, last name,
phone, city and country. For every book purchase, the bookstore creates an order that stores the
customer id, book isbn, the quantity and the purchase date. The order sales will be added to the counter
cash that accepts money on each book sale. Your system can provide reports about all the books in the
store, book orders made, and customers who purchased books from this store.

#include<string>

using namespace std;

class order 
{
private:
    double id;
    string isbn;
    string quantity;
    string PurchaseDate;

public:
    void SaveInformation(double&, string&, string&, string&);
    order(double&, string&, string&, string&);
    order();
};

class customer
{
private:
    double id;
    string firstName;
    string secondName;
    double phone;
    string city;
    string country;

public:
    void customerInformation(double, string, string, double, string, string)const;
};

class book
{
 private:
     double id;
     string title;
     string author;
     string publisher;
     string edition;
     double YearOfpub;
     double price;
 public:

     void NumberOfBook(int);
     double getId(double);
     string getauthor(string);
     string publisher(string);
     string edition(string);
     double YearOfpub(double);
     double price(double);  
};

class counter
{
 private:
     double Money;
     double NumberOfBook;

 public:
     void DecreaseBook(double );
     void IncreaseMoney(double );
};


>>>>>>>>>>>>>>>>>>>>>>>>>>

#include<string>

using namespace std;



// implementation : definition functions of classes

void order::SaveInformation( double& Id, string& Isbn, string& Quantity, string& PurchaseOfDate)
{
    id = Id;
    isbn =  Isbn;
    quantity = Quantity;
    PurchaseDate = PurchaseOfDate;
}
order::order(double& Id, string& Isbn, string& Quantity, string& PurchaseOfDate)
{
    id = Id;
    isbn =  Isbn;
    quantity = Quantity;
    PurchaseDate = PurchaseOfDate;
}
order::order()
{
    id = 0;
    isbn = "";
    quantity = "";
    PurchaseDate = "";
}


void customer::customerInformation(double Id, string FirstName, string SecondName, double Phone, string City, string Country)const
{
    Id = id;
    FirstName = firstName;
    SecondName = secondName;
    Phone =phone;
    City =city;
    Country = country;

}


void book::NumberOfBook(int n)
{
}
double book::getId(double id)
{
    return id;
}
string  book::getauthor(string author)
{
    return author;
}
string book::publisher(string publisher)
{
    return publisher;
}
string book::edition(string edition)
{
    return edition;
}
double book::YearOfpub(double YearOfpub )
{
return YearOfpub;
}
double price(double price)
{
    return price;
}


void counter::DecreaseBook(double sealBook )
 {
     NumberOfBook -= sealBook;
 }

 void counter::IncreaseMoney(double price)
 {
     Money = Money + price;
 }

Recommended Answers

All 6 Replies

And, your problem is...?

I want to know if my code is right

could you help me to check it

The way to check it is to run it and see if it does what it's supposed to do. If it doesn't then the program is wrong. From the code you posted I believe you have just scratched the surface of what the assignment requires.

Read the exact specifications of the assignment--what has to be done (methods) what has to be tracked/stored (instance variables) and create the classes with the variables and the methods to perform the required processing. It looks to me that you are on the right track and all you really need is to carefully read and think about what the problem is asking. Maybe get out of a piece of paper and plan the design out very carefully and then code that design so as not to miss anything. The objects and methods required are right there in the requirements you listed and if you carefully write them out then you will be sure to get everything.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.