Restaurant

CS 139 Algorithm Development
PA1: Fine Dining

Part A Due in Canvas by Wednesday, Sept 17 at 11:59PM

Part B Due in WebCAT by Wednesday, Sept 24 at 11:59 PM

  • -10% on Thursday, Sep 25th
  • -20% on Friday, Sep 26th
  • -35% on Sunday, Sep 28th
  • -50% on Monday, Sep 29th
  • Not accepted afterwards
Part C due in Canvas by Thursday, Sept 25 or one day after you have successfully submitted to WebCAT.

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

 

UPDATES: 9/22/2014 - Changed the prompt for the meal amount to "How much was the total bill? " due to inconsistency in how that was shown in the PA.

9/23/2024 - Changed the output in both areas to be consistent. The server line was missing in the first output example.

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 provide 3 examples of different values that will be used for your testing. These examples should include the the amount of the bill and the resulting tax, 15% gratuity, 18% gratuity, and 20% gratuity. Part A will be in the form of a quiz and will have some additional questions. You must finish PART A before you can get help with PART B as you should always think through a problem before you attempt to solve it.

PART B - Submitted to webcat. 

You will write a single Java program, BillMaker.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 Deliverables

  1. Zip your BillMaker.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.

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.