Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help. How do I solve this? Bonus: I'll rate Barber Shop: Write a Java program that calculates and displays a barber shop menu and

Need help. How do I solve this? Bonus: I'll rate

image text in transcribed

Barber Shop: Write a Java program that calculates and displays a barber shop menu and a customer's bill. The program will display a banner showing the prices for a haircut ( $13.75), shave ($12.75), and beard trim ($12.25) and then prompt the user to enter the number of each menu item completed. A suggested tip will also be presented for the total services charged. Your program will declare the following constants: LOW_TIP_RATE =0.11; MED_TIP_RATE =0.14; HIGH_TIP_RATE =0.30; NY_TAX_RATE =0.0725; HAIRCUT_PRICE =13.75; SHAVE_PRICE =12.75; BEARD_TRIM_PRICE =12.25; You must use the following variable names: haircuts, shaves, beardTrims, totalservices, totaltax, totalBill, lowTip, medTip, and hightip. The tip amounts should be calculated on the totalservices amount - not on the totalBill amount. Declare haircuts, shaves, and beardTrims as int datatypes, and all calculated variables and constants as double data types. To format your output so that it prints properly, you should use the " "t" escape sequence to tab over ("t t" will tab over twice). You must space down a line after the services amounts are entered, and after the total bill amount for the tip recommendations (see sample run below). All dollar amounts must be aligned neatly with dollar signs, and displayed to two decimal places (to the penny), and all unnecessary decimal places after the pennies must be removed. You must use the technique described in the sample program in chapter 2 called "SalesTax.java". If the calculated amount results in the pennies column equal to zero, don't worry about that for now. We will learn how to correct that later. The last line should say thank you, include your first name, and either a smiley face (Unicode character \u263A ) or a heart (Unicode character \ u 2764) - your choice. Be sure to include a program header block similar to the ones you have used in previous assignments. Your output should be formatted exactly as the sample runs below

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

JDBC Database Programming With J2ee

Authors: Art Taylor

1st Edition

0130453234, 978-0130453235

More Books

Students also viewed these Databases questions

Question

List some problems associated with risk tolerance questionnaires.

Answered: 1 week ago

Question

Prepare an electronic rsum.

Answered: 1 week ago

Question

Strengthen your personal presence.

Answered: 1 week ago

Question

Identify the steps to follow in preparing an oral presentation.

Answered: 1 week ago