CS2070 Assignment 3: The Restaurant Bill solved

$25.00

Original Work ?

Download Details:

  • Name: Assignment-3-8jvtaw.zip
  • Type: zip
  • Size: 12.89 KB

Category: Tags: , You will Instantly receive a download link upon Payment||Click Original Work Button for Custom work

Description

5/5 - (1 vote)

Objectives

  • Read input from the keyboard of various types of data.
  • Print output to the screen.

Motivation

A restaurant will print a bill for the customer at the end of a meal. This bill will include the price of the meal, the sales tax, and three suggested tip amounts based on the sum of the price and the sales tax for a low, medium, or high amount (which is typically 15%, 18%, and 20%). (The customer can still tip whatever they wish.) Last of all, it prints the name of the server. Write this program. The sales tax in Tennessee is 7%.

There are complications in working with inputs of various types. You will be asked to read in inputs of various types and you should run to odd issues with your program. There is a section in the book on dealing with a mixture of nextLine and other next calls.

Instructions

Name your project FirstnameLastnameAssignment3

Have your program do the following.

  1. Make sure that the sales tax is stored as a constant double equal to 7.0 and that the three suggested tip levels (low is 15%, medium is 18%, and high is 20%) are also stored as constant doubles.
  2. Greet the user with your name and what this program accomplishes.
    • For example, “Welcome to Dr. Church’s Restaurant Bill Tool.”
  3. Prompt the user for the price of the mill.
  4. Prompt the user for the name of the server.
  5. Display the price of the bill.
  6. Compute the sales tax and display it.
  7. Display the total (bill plus sales tax).
  8. Compute and display the low tip suggestion.
  9. Compute and display the medium tip suggestion.
  10. Compute and display the high tip suggestion.

Your source code must include the following documentation:

  • Your name
  • The class (CS 2070) and the section number (on ground is 08, online is W1).
  • The date on which you turned in the assignment.
  • A short description of the software. Usually a sentence or two is sufficient.

Example Run

Since we haven’t covered Java’s approach to number formatting, it’s okay that these numbers do not round to two decimal places.

Welcome to Dr. Church’s Restaurant Bill Tool.
Enter the bill amount: 12.50
Enter the server’s name: Charles Martinet

Subtotal:  12.5
Sales Tax: 0.8750000000000001
15.0%:   2.00625
18.0%:   2.4074999999999998
20.0%:   2.6750000000000003

Your server is Charles Martinet.

Turning it in.

To turn in your application, find the folder containing your entire project (not the folder with the “java” file), zip it up, and turn it in.