Question: Please help! Java program and must be made in Eclipse using an execution enviroment JRE: JavaSE-1.8. Sammy's Seashore Rentals rents beach equipment such as kayaks,
Please help! Java program and must be made in Eclipse using an execution enviroment JRE: JavaSE-1.8.
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. Also the customer will still receive a discount if he/she spends more than $100 or rents an umbrella. So, if the customer rented a canoe for 3 hours and 12 minutes, the cost would be $124.20 (3 hours times $40.00 per hour plus 12 minutes times $1.50 per minute minus the 10% discount).
In addition to all the things that program needed to do previously will also need to:
Determine a rate of rental based on the following list: o Canoe is $40 per hour
o Kayak is $20 per hour
o Surf board is $45 per hour
o Beach chair is $10 per hour
o Umbrella is $12 per hour
o Any other item is $8.50 per hour
You may count on all user input being all lower case for the purpose of determining which item the user entered
The user may rent multiple items. You will need to continue asking for items from the user until the user enters No or no. You will need to calculate and output each rental before checking if the user has another item to enter.
You must do data validation on the input from the user for hours and minutes to ensure that it is not less than zero and, for minutes, that it is not greater than 59 for minutes
You must print any money amount with 2 places after the decimal
Required Elements of the Program:
Must repeatedly ask user for items rented, etc. until user indicated no more items
Must ask user for hours and then ask for minutes
Must do data validation on the input of hours and minutes
Must use the appropriate selection structure to determine the hourly rental rate
Must use the appropriate loop(s) for any repetition situation
Must use the appropriate String class method to compare strings
Must output item rented, total cost, and the hours and minutes of rental
Must use Boolean logical operator for determining whether or not there is to be a discount
Must have total cost print with 2 places after the decimal
Must have a thank you message at the end
Must include $ in front of total amount
Output must be similar to this below:
Example 1
Welcome to Sammy's Seashore Supplies where it's always a Sunny day at the beach!
What item did you rent? bucket and pail
How many hours? 2
How many minutes? 23
The cost for renting a bucket and pail for 2 hours and 23 minutes is $51.50.
Did you rent another item? No
Thank you for your business.
Example 2
Welcome to Sammy's Seashore Supplies where it's always a Sunny day at the beach!
What item did you rent? Canoe
How many hours? -3
That is not a valid number. Try again.
How many hours? -6
That is not a valid number. Try again.
How many hours? 3
How many minutes? -12
That is not a valid number. Try again.
How many minutes? -17
That is not a valid number. Try again.
How many minutes? 117
That is not a valid number. Try again.
How many minutes? 17
The cost for renting a canoe for 3 hours and 17 minutes is $145.50.
Did you rent another item? Yes
What item did you rent? kayak
How many hours? 4
How many minutes? -3
That is not a valid number. Try again.
How many minutes? 33
The cost for renting a kayak for 4 hours and 33 minutes is $116.55.
Did you rent another item? No
Thank you for your business
Thank you in advance. Please help. Also could you show me what your output looks like aswell please.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
