Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

help java program. Sammy's Seashore Rentals rents beach equipment such as kayaks, canoes, surf boards, beach chairs, umbrellas and other items. Sammy has asked you

help java program.

Sammy's Seashore Rentals rents beach equipment such as kayaks, canoes, surf boards, beach chairs, umbrellas and other items. Sammy has asked you to write a program that will calculate the cost of rental of any item(s). Each item has a different rental cost. The cost of rental is cost for a particular item for each full hour and $1.50/minute for anything less than a full hour. So, if the customer rented a canoe for 3 hours and 12 minutes, the cost would be $138.00 (3 hours times $40.00 per hour plus 12 minutes times $1.50 per minute). Additionally, Sammy will provide a discount of 10% if an umbrella is rented or if the cost for renting any time is greater than $100.

Your main() method will need to be changed to utilize the additional methods instead of doing all the work itself.

The other static methods will be implemented as follows: printWelcome() Parameters: None Return type: void It will print the welcome/introduction message.getItem() Parameters: None Return type: String It will ask for the user for the item rented and will return that value.getHours() Parameters: None Return type: int It will ask for the user for the hours rented, validate that the number entered is 0 or greater, and will return a valid value. getMinutes() Parameters: None Return type: int It will ask for the user for the minutes rented, validate that the number entered is 0 or greater, and will return a valid value.calculateRate() Parameters: 1 string Return type: double The parameters will be the item rented. The method will determine which hourly rate will be used based on the parameter and will return the value that represents the rate. calculateCost() Parameters: 2 integers, 2 doubles Return type: double The parameters will be the hours, minutes, and rates for each. The method will calculate the cost of the rental and will return that value. isDiscount() Parameters: 1 string, 1 double Return type: boolean The parameters will be the item rented and final cost. The method will determine if the item is an umbrella or the final cost is greater than $100 and will return true to indicate if a discount should be applied or will return false if a discount should not be applied.printCost() Parameters: 1 string, 2 integers, 1 double Return type: void The parameters will be the item rented, the hours, minutes, and total cost for the rental. The method will print the statement that tells the cost of the rental. repeat() Parameters: None Return type: boolean This method will ask the user if another item was rented and will return the users answer.printThankYou() Parameters: None Return type: void It will print a thank you message at the end of the program.

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_2

Step: 3

blur-text-image_3

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

Beginning Apache Cassandra Development

Authors: Vivek Mishra

1st Edition

1484201426, 9781484201428

More Books

Students also viewed these Databases questions

Question

How do Data Types perform data validation?

Answered: 1 week ago

Question

How does Referential Integrity work?

Answered: 1 week ago