CSCI 131 - Techniques in Programming, Spring 2014

    Home | | Schedule | | Assignments | | Lectures | | Resources

    Project Five Check

    Nile.com

    Due Date: Friday, April 25, at 10:00 a.m.

    Before you start:
    Read carefully the description of project 5 in the project 5 assignment. Copy the files from the csci131 PROJ5 directory as instructed and study the files you are given.

    Introduction. The purpose of this check is twofold:

    1) To make sure you complete a portion of your project early, so you do not end up having to complete the entire project in the final days before it is due.

    2) To give you practice in implementing your program one part at a time.

    Description The best way to implement complex programs is to implement them one piece at a time and make sure each part compiles and runs correctly before moving on to the next step. In your implementation of project 5, it is essential that your program correctly read in the inventory from the data file and be able to print it out. If these steps do not work correctly, the other functions will not be able to function correctly either. Therefore, for this check, you will implement only the functions in proj5.cc and two of the functions in orders.cc-- ReadInventory( ) and printInventory( ). You will not implement the functions in customerRec.cc. In addition, you will use function stubs for the three other functions in orders.cc. Function stubs are functions that have the correct function header, but the body of the function is empty. They are used as place holders for program testing in the early stages so that the program will compile and they can be called but they do nothing. You can see some function stubs in the customerRec.cc file that you copied from the csci131 PROJ5 directory.

    Completing the project check
    To receive full credit on the project check you must do the following:

    • Add the required function prototypes to orders.h
    • Implement ReadInventory( ) in orders.cc
    • Implement PrintInventory( ) in orders.cc
    • Include a function stub for ProcessPurchases( ) in orders.cc
    • Include a function stub for InventoryStatus( ) in orders.cc
    • Include a function stub for BackOrderStatus( ) in orders.cc
    • Implement main() in proj5.cc to read in the inventory, print a menu prompt the user to select an option and call the appropriate function. Note that only the L option and the Q option will actually do anything at this stage. The P, I, and B options will be calling the appropriate function stubs, but the stubs will not do anything.
    • Debug your code so that it compiles and runs correctly (i.e. it reads in the inventory and prints it out when the user chooses 'L' from the menu). Use the compile command:
      g++ -g -Wall proj5.cc orders.cc customerRec.cc -o proj5
    • Do not implement anything else until you have submitted your project check files. (If you want to continue working on your project before the due date for the check, simply submit and print out the files first, before you start to implement the other functions).
    Program testing: As you write your program, you can test it along the way by compiling and running it by itself. You can compile your program using the command:

      g++ -g -Wall proj5.cc orders.cc customerRec.cc -o proj5
      

    You can then run it by typing, ./proj5 at the Linux prompt on your terminal.
    Do not use test5 to test this part of your program.

    The following is an example of a sample run of the proj5 program once you have completed the requirements of the project 5 check:

    Inventory has been read.
    There are currently 6 items for sale.
    
    
    Please choose one of the following options: 
    
       (L)  Print a list of the items for sale.
       (P)  Process a customers purchase requests.
       (I)  Create a file with the current inventory status.
       (B)  Create a file with customers waiting for backorders.
       (Q)  Quit.
    
    Enter menu choice: L
    L
    
    PRODUCT TITLE                 CATEGORY       PRICE     NUMBER IN STOCK
    The bold and the ugly         Book           26.94        27
    The fully dressed ladies      CD             12.37        34
    My Lunch with Andre           Video          19.99         1
    The March Hares               Book           15.33         5
    Brahms Lullaby                CD             16.66         3
    Trivial Millionaires          Game            9.85        12
    
    
    Please choose one of the following options: 
    
       (L)  Print a list of the items for sale.
       (P)  Process a customers purchase requests.
       (I)  Create a file with the current inventory status.
       (B)  Create a file with customers waiting for backorders.
       (Q)  Quit.
    
    Enter menu choice: p
    p
    
    
    Please choose one of the following options: 
    
       (L)  Print a list of the items for sale.
       (P)  Process a customers purchase requests.
       (I)  Create a file with the current inventory status.
       (B)  Create a file with customers waiting for backorders.
       (Q)  Quit.
    
    Enter menu choice: v
    v
    
    Invalid Entry.  Please re-enter menu choice.
    
    Please choose one of the following options: 
    
       (L)  Print a list of the items for sale.
       (P)  Process a customers purchase requests.
       (I)  Create a file with the current inventory status.
       (B)  Create a file with customers waiting for backorders.
       (Q)  Quit.
    
    Enter menu choice: i
    i
    
    
    Please choose one of the following options: 
    
       (L)  Print a list of the items for sale.
       (P)  Process a customers purchase requests.
       (I)  Create a file with the current inventory status.
       (B)  Create a file with customers waiting for backorders.
       (Q)  Quit.
    
    Enter menu choice: B
    B
    
    
    Please choose one of the following options: 
    
       (L)  Print a list of the items for sale.
       (P)  Process a customers purchase requests.
       (I)  Create a file with the current inventory status.
       (B)  Create a file with customers waiting for backorders.
       (Q)  Quit.
    
    Enter menu choice: q
    q
    
    Thank you for shopping Nile.com!
    

    To submit your finished project check:
    1. Submit your program files electronically in the directory which contains your proj5.cc, customerRec.cc, customerRec.h orders.cc and orders.h. (The submit program will not accept a program that does not compile). Use the submit command with proj5check as the final argument.

    2. Hand in a hard copy of the files you submitted electronically. Hand this to your instructor in class on the project check's due date.

    3. Print out the grading header, put your name at the top of it, and hand it in with your hard copy.

    Get started early and have fun!

    Honor code: Please review the collaboration policy on the main course webpage. Also refer to the math and CS department honor code policy.


    Home | | Schedule | | Assignments | | Lectures | | Resources



    Computer Science 131
    Last Modified: April 13, 2014
    Page Expires: September 30, 2014