From 7467fbefd9e2123c7c05ef0de7a7abb5716d5fec Mon Sep 17 00:00:00 2001 From: Googl Date: Fri, 16 Nov 2012 07:21:34 -0500 Subject: [PATCH] 'Typed coursework 2 question' --- Documents/bookshop.cc | 43 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/Documents/bookshop.cc b/Documents/bookshop.cc index d53a6f7..600158b 100644 --- a/Documents/bookshop.cc +++ b/Documents/bookshop.cc @@ -1,15 +1,48 @@ // Copyright 2012 Carey Riley, Dwayne Reid -// A Bookshop Inventory Management System +// A Bookshop Inventory Management System +/* A small Bookshop maintains the inventory of books sold in the shop. The list + * includes (but is not limited to) the following details: + * Author's name, + * Title of the book(s), + * Price of each each book, + * Publisher of each book, + * Stock levels of each type in a tabular form as shown below + * ---------------------------------------------------------------------- + * | BOOKSHOP DATABASE | + * ------------------------------------------------------------------------ + * | Author's Name | Book Title | Unit Price | Publisher | Stock Count | + * ----------------------------------------------------------------------- + * | Deitel & Deitel| C++...Program| $2500.00| Pearson | 15 Copies | + * ------------------------------------------------------------------------ + * | | | | | | + * ------------------------------------------------------------------------ + * + * Whenever a customer wants a book, the sales person inputs the title and author + * and the system searches the list (database) and displays whether it is available + * or not. If available, the total cost of the requested copies is displayed; + * otherwise the message "Required copies not in stock" is displayed. + * + * Design a system using a class called books with suitable member functions, + * member variables and constructors. Use the New operator in your constructors + * to apportion possible memory requriements. Objects created in main should be + * able to access appropriate member functions to carry out whichever task(s) they + * are designed to perform. + * + * In writing your program, use comments to facilitate comprehension and explain + * all assumptions you might be forced to make for the system to function + * optimally. Innovation as well as user friendliness of your interface would be + * rewarded. + * / + #include #include // #include #include -namespace { // Response to not enough in stock +namespace { using std::setfill; using std::setw; using std::cout; - void NotInStock(void) {cout << "Required copies not in stock\n";} -// void NotInStock(void) {printf("Required copies not in stock\n");} + void NotInStock(void) {cout << "Required copies not in stock\n";} // Response to not enough in stock void PrintStockTableHeader(void) { // Stock Table Header cout << setw(80) << setfill('_') << '\n' << setfill(' ') << @@ -22,6 +55,8 @@ namespace { // Response to not enough in stock " Stock Count|" << '\n' << setw(80) << setfill('_') << '\n' << setfill(' '); } + + BookSearch(std::string, std::string) { } class Books { // public: -- 2.11.4.GIT