Menu

[Solved]Write C Program Control Stock Books Small Bookstore Part 1 Client Orders Book System Check Q37245088

Write a C program to control the stock of books of a smallbookstore.

Part 1:

When a client orders a book, the system should check if thebookstore has the book in stock. If the bookstore keeps the titleand there is enough stock for the order, the system should informthe price per copy to the client, as well as the total price of thepurchase. The client orders a book using its code.

If the client confirms the purchase, the system should ask theclient’s name and address. (This information will be sent to theshipping system.)

If the bookstore keeps the title, but there is no book in stock,the system should inform the client and register in a file the codeof the book and the date that the low stock was detected, so themanager can request to the publisher.

Part 2:

By the manager request, the system should check how many copiesof each book are in stock. If a book has only one copy or none, thesystem should register in a file the code of the book and the datethat the low stock was detected, so the manager can request to thepublisher. The system will read the title of a book from a file(books.txt), which structure is:bookCode           BookTitle. (Your program will open the file to read. It reads thecode, checks if it is the code of the book with no stock. If it is,read the title of the book and display it.)

Use: (parallel) arrays, loops, and files. Use of functions willbe counted as extra credit.

Suggestion: Create an array with about 6 codes of books to testyour program. The parallel array will be needed to keep thequantity in stock and the price of the book.

Add comments to your program to explain your decisions.

Evaluation:

  1. Correct use of arrays and variables.
  2. Correct use of loops.
  3. Correct use of files.

Expert Answer


Answer to Write a C program to control the stock of books of a small bookstore. Part 1: When a client orders a book, the system s… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *