Question: in Java Write a class named Beach that has the following instance variables: hotelName. A String object that holds the name of the hotel city.

in Java Write a class named Beach that has the following instance variables: hotelName. A String object that holds the name of the hotel city. A String variable that holds the name of the city where you are staying numDays the number of days you are staying cost the cost of the vacation The class should have the following three constructors. Even though we do not use all three in our specific example, you still need to include them. Remember this is a blueprint that can be used in many applications. Other applications might use the other constructor): A no-argument constructor A full constructor that has parameters for all four fields (also called instance variables) A constructor that takes in the first two fields. (This method will only have two items in the parentheses in the signature see Employee for an example) Write your toString() and your getters and setters (which should always be placed at the bottom).

Write a driver program named BeachDriver that creates the following three trips by calling the appropriate constructor. Have it print each of them out by calling the toString() method. Then call the setters to set the last trips cost to 1800 and the number of days to 7. Print it out again. in Java Write a class named Beach that has the following instance SEE SAMPLE FOR THE OUTPUT BELOW variables: hotelName. A String object that holds the name of the hotel

Hotel Name Hilton Marriott InterContinental City Myrtle Beach San Diego Miami Beach Number of Days 4 10 Cost $560 $1200 BeachDriver.java You are staying at the Hilton in Myrtle Beach for 4 days for a cost of $560.00 You are staying at the Mariott in San Diego for 10 days for a cost of $1,200.00 You are staying at the Intercontinetal in Miami for 0 days for a cost of $0.00 You are staying at the Intercontinetal in Miami for 7 days for a cost of $1,800.00

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!