Restaurant

CS 139 Algorithm Development
PA2: Fine Dining Refactored

Part A Due in Canvas by Friday,October 3 at 11:59PM

Part B Due in WebCAT by Wednesday, October 8 at 11:59 PM

  • -10% on Thursday, October 9
  • -20% on Friday, October 10
  • -35% on Sunday, October 12
  • -50% on Monday, October 13
  • Not accepted afterwards
Part C due in Canvas by Thursday,October 9 or one day after you have successfully submitted to WebCAT.

Part D due in class on Thursday, October 10 or one day after you have successfully submitted to WebCAT.
meal

 

 

Objectives - At the conclusion of this assignment students will have demonstrated that they can:

Background

When dining in a restaurant, patrons are presented with a check for their meal. In this application you will calculate the tax and suggested gratuities for a meal. This application will require you to produce a "check" like you might get in a restaurant.

Requirements

PART A - Graded as a homework assignment. There will be a separate Canvas Assignment for this.

You will stub out a program called BillMakerTools.java. This program will contain the methods outlined below. The stubs must be compilable working stubs such as you built in Lab 05B. They should be fully documented. See specifications below for the required methods in BillMakerTools.java. BillMakerTools will not have a main method except if you build one for testing.

PART B - Submitted to webcat. 

You will write a Java program consisting of BillMaker.java and BillMakerTools.java, that must:

<blank>
Total bill: $ 88.00
Tax: $ 10.38
You owe: $ 98.38
<blank>
Your server was kelly.
Tip 15%: $ 13.20
Tip 18%: $ 15.84
Tip 20%: $ 17.60
<blank>
Thank you for dining with us.

Output MUST conform exactly to that shown. Failure to match it exactly will result in WebCAT errors.  Each line above must end with the new line character directly following the output value and the blank lines <blank> in the output are significant. These lines should not include a blank space character, but should include a single new line character.

A complete dialog (with input values highlighted in red would look like)

How much was the total bill? 100
Who was the server? kelly

<blank>
Total bill: $100.00
       Tax: $ 11.80
   You owe: $111.80
<blank>
Your server was kelly.
   Tip 15%: $ 15.00
   Tip 18%: $ 18.00
   Tip 20%: $ 20.00
<blank>
Thank you for dining with us.

NOTES:

  1. Each of the output lines must terminate with a single newline "\n" character with the exception of the input prompts.
  2. All of the colons should line up vertically. The T for the total bill will be in the first position and all colons will line up with the one after "bill:".
  3. Each line identified by <blank> should have a single newline character and no spaces.
  4. All currency amounts must be formatted with a $ followed by up to three digits followed by a decimal point and exactly 2 digits following the decimal place. Valid formatting would look like $ 0.50, $ 12.95, $ 1.50, etc.
  5. Your tax rate should be a named constant in the file.
Your program should use appropriate data types for the values being input and calculated, and appropriate and meaningful names for all variables and constants. The program source must follow all StyleGuide conventions used in this class.

Part B Structure

BillMaker will contain a single method, main which will call all of the other methods in BillMakerTools to perform the calculations and output the results. Nothing should be directly output in BillMaker.

BillMakerTools will have the following methods:

Part B Deliverables

  1. Zip your BillMaker.java and BillMakerTools.java into a zip file. Submit the zip file via Web-CAT (http://webcat.cs.jmu.edu).
  2. Your program will be judged on correctness (80%) and conformance to the StyleGuide (20%). The checkoff chart is found here. Deductions for failing to follow the structure will be taken from the 80% correctness score.

Part C, D - Reflection and Pair Programming Log - graded as regular homework assignments. There will be separate Canvas Assignments for this.

You will write a reflection document for this assignment which will let you consider the process of building this program. It will also contain a place to critique this assignment for this class.

In addition, you should keep a log showing how much time you and your partner worked together and how much time you worked alone.

Honor Code

This is a pair programming assignment. You may work with your partner, but may not work with any other team. This assignment should be viewed as a take home exam. Your work on the assignment and your submission must conform to the JMU Honor Code. Authorized help is limited to the classroom handouts, lab material, the TAs for any CS139 or CS 149 section, and either professor. Copying work from another student not in your partnership or the Internet is an honor code violation, which will result in a zero on the assignment and possibly further sanctions. Your work on this assignment is subject to review by MOSS which is a plagiarism detection tool for programs. Submission to WebCAT constitutes your submission of work for academic credit and your agreement that your work may be submitted to MOSS.