CMIS 107
Take Home Final Examination

Rules:

  1. Modify the Midterm Examination to include 'objects'. That is, create an instantiable class, and then declare Objects from this class. For example, create a Beverage Class for the Beer and Soda items, create a Snack Class for the Chips and Pretzels items.
  2. For 'A' quality work, additionally create a Base Class (for example, a Food Class) from which your other classes inherit. 
  3. You may turn in your Examination any time

For those of you who may not have yet completed the Midterm, here are the Midterm Examination Requirements.


Take Home Midterm Examination

  1. This is a take home midterm examination. I give take home examinations to provide you with a rich, pressure free learning experience--be sure to take advantage of it. The program took me 10 minutes to write. It may take you more time to complete (some of you may complete it quicker)
  2. You have until Wednesday, October 22nd to write your program.
  3. Your program is to be saved on a diskette and submitted to me at the BEGINNING of class on October 22nd
  4. In addition to the program, I would like a log of your efforts in completing the program. The log is to include the dates and times that you worked on the program, what lines of code you wrote and when, what problems you encountered in writing the program, what sources you needed to consult to complete the program (i.e. I had to re-read the entire book, I consulted a web site for help on loops, etc). The log will comprise 20% of your midterm grade.
  5. Your program is to be written by you and only you--no group work, no tutors, no fellow member of the class, no family member is to assist you in completing the program
  6. As much as I would love to help you with the program, I can't----you may email me with questions concerning the requirements, but I can't assist you in completing the examination. For the exam, you are on your own.
  7. You may use your book, notes, whatever to complete the program--but no person is to assist you
  8. I may, at my discretion, ask you to reproduce your efforts and re-write the program in front of me during class on October 22nd. Failure to be able to reproduce the program during that period will lead me to believe that the take home midterm has not been

Program Requirements:

  1. Write a program for the Smiley Grocery Store. Smiley's Grocery Store sells 4 items, and 4 items only----here are the items, along with the selling price for each
Item Selling Price
   
Soda  $3.99
Beer   $10.99
Pretzels   $2.25
Chips    $3.45
  1. Display a menu, in which the user is asked to select an item he or she wishes to purchase. I suggest that you prompt the user to enter 'S' for Soda, 'B' for Beer, 'P' for Pretzels, 'C' for Chips. Provide a way for the user to tell you they have no more items they wish to purchase.
  2. After the user enters their choice, ask them how many of the item they wish to purchase.
  3. Display a message telling the user how much their selected items will cost them, along with a running total of their purchases so far.
  4. The program should then ask them to select an item (See #2). If the user is done making purchases, thank them for using your program, and display a message indicating the total number of items they have purchased, and the total sales price.
  5. Needless to say, the program needs to use appropriate C++ statements to display messages to the user, to gather user input, to count (See #5), to calculate subtotals (See #4), to calculate totals (See #5), to make selections (See #2) and to loop (See #2 and #5).
  6. If you have any questions about the requirements, feel free to email me at johnsmiley@johnsmiley.com

Test Data:

If the user selects 1 Soda, 1 Beer, 1 Pretzel and 1 Chip, the item count will be 4, and the total price will be $20.68