I have to make a library system program that can buy and sel

I have to make a library system program that can buy and sell books. The library store has the list of the inventory and the program user can look at them and order the books they want.

In doing the program, I will need to use:

1. Book Structure: Title, Author, ISBN, Price, and Available copies

struct Book

{string title, author, ISBN;

etc.

};

2. Also at the beginning, I will need to prompt the user the file name containing the data for the filename that hold the book list

bool Prompt (ifstream& fin)

{

       string               File_name;   

       cout << \"enter the filename holds book collection: \";

       cin >> File_name;                              

       fin.open(File_name.c_str()) ;           

       if (fin.fail())           

       {            

       cout <<\"Bad input\";

       return false;

       }

       else

       {return true;}

}

3. If file is read succesfuly, display this menu with the following options:

a) Buy a book

b) Return a book

c) Request to replace a book

d) Display availability

e) Print alphabetically sorted book list (based on Title)

f) Print the details of a book (Prompt user for the title)

g) Print titles of books by an author(prompt user for authors last name)

h) Exit (Print a list of sales and totals sales)

Also:

1) No more than 100 books in the book collection

2) You can modify the structure as you like by adding more fields

3) Each member can buy as many books as they like

Requirements:

1) Must use arrays of structures to store books data.

2) Program must be modular (Use as many functions as possible).

3) Prompt user for all file names.

4) Verify files opened and have data in them.

Sample input file (title, author, isbn, price, and availability):

Hey Arthur

Jones, Michael

123A2345V 12.50 5

How to play baseball

Okeef, Dickins

144R3333G 21.75 0

Solution

Create a few functions and pass by reference + value. Use stiring and void functrions


Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site