Intermediate Business Programming with C++
Specification:
You work in the MIS Department of Barnes and Nelson Book Stores. You have been asked to write a book inventory program. The book information to be stored includes: book name, ISBN, year published, number on hand, cost and price. In addition they need to be able to store from one to four authors' names. The program is to have the following features:
-
Load the inventory from disk (there are at most 500 books in inventory at a time)
-
Enter new books
-
Display the book information given the ISBN
-
Edit book information one item at a time presented with the current information given the ISBN
-
Delete books from the inventory given the current information
-
Save the inventory to disk.
Menu output:
Inventory
Modification
-
Enter New
Records
-
Display by
ISBN
-
Edit Records
-
Delete Records
-
Exit
Which?
Sample Data:
Book Data | Example 1 | Example 2 | Example 3 | Example 4 |
---|---|---|---|---|
Book Name | The First One | The Second One | The Third One | The Fourth One |
ISBN | 111-11-11111-1 | 222-22-22222-2 | 333-33-33333-3 | 444-44-44444-4 |
Year Book was Published | 1922 | 1945 | 1075 | 2003 |
Number OnHand | 5 | 125 | 244 | 300 |
Cost per Book | $12.34 | $45.78 | $76.45 | $124.67 |
Total Cost of Books | $61.70 | $5722.50 | $18653.80 | $37401.00 |
Price per Book | $22.65 | $76.78 | $99.56 | $198.56 |
Total Selling Price | $113.25 | $9597.50 | $24292.64 | $59568.00 |
Authors 1 | Some One | Some Else | Another Person | The Real One |
Authors 2 | none | none | none | none |
Authors 3 | none | none | none | none |
Authors 4 | none | none | none | none |
Design:
-
UML Class design: bookInventory.gif
-
Structure chart: sc_doInventory.gif
-
Pseudo code: pc_doInventory.txt
Coding:
-
class definition header file (notice that the data types of the attributes and methods were changed in this header from the UML diagram to reflect the data types needed by C++): bookInventory.h
-
class methods source file: bookInventory.cpp
-
modules header file: theFunctions.h
-
execution source file: doInventory.cpp
Категории