Question: Write a program for a hotel bill as follows. Room Choices Cost per night Standard room $ 1 2 5 Suite $ 4 0 0

Write a program for a hotel bill as follows.
Room
Choices
Cost per
night
Standard
room
$125
Suite $400
Cost
Single lunch $11.95
Single dinner $19.95
Do the following:
1. From the main method, write a call to a method named,
getRoomCost. No values are passed to this method. Within this
method, write coding where user can enter the number of
standard rooms taken and the number of nights stayed in the
hotel. Compute the total cost and return this value back into main
method and print it.
2.Similar to step 1, write a call to a method named, getSuiteCost.
Follow the exact procedure as in step 1 to compute the total cost
of staying in a suite and return this value back into main method
and print it.
3.From the main method, write a call to a method named,
getLunchCost, and no values are passed to this method. Within
this method, write coding where user can enter the total number
of lunches ordered (number of lunches ordered has nothing to do
steps 1 and 2). Compute the total cost of lunches and return this
value back into main method and print it.
4.Similar to step 1, write a call to a method named, getDinnerCost.
Follow the exact procedure as in step 3 to compute the total cost
of dinners and return this value back into main method and print
it.
5.From within the main method, add values corresponding to steps
1 to 4 and compute the total cost before taxes. Pass this value to
a method named getTaxes. Taxes are 8%. Return the value of
taxes back into main method and print it.
6.From the main method, write a call to a method named, getTips.
From the main method, pass the total lunch and total dinner costs
to this method. Tips are 15% of the combined lunch and dinner
costs. Pass this value back into the main method and print it.
7.From within the main method, add taxes and tips to the total
before taxes to compute the total bill. Print this value.
User Input:
Enter the number of standard rooms taken =2
Enter the number of nights stayed in standard rooms =3
Enter the number of suites taken =3
Enter the number of nights stayed in suites =2
Enter the total number of lunches ordered =15
Enter the total number of dinners ordered =12
Expected Output:
Total cost of standard rooms =2x3x125= $750
Total cost of suites =2x3x400= $2400
Total cost of lunches =15x11.95= $179.25
Total cost of dinners =12x19.95= $239.40
Grand Total before taxes =750+2400+179.25+239.40=
$3568.65
Taxes =0.08(3565.68)= $285.49
Tips =0.15(179.25+239.40)= $62.80
Grand Total bill =3568.65+285.49+62.80= $3916.94

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!