(a)Create a Java class called HolidayHome to represent a short term holiday lease such as a holiday house or apartment for a holiday home rental business. Include brief comments in your class definition as necessary. The class should have:

  • four fields that capture the holiday home's address, its rental price per month, the number of bedrooms, and whether the holiday home has Wi-Fi.
  • a constructor that initialises the fields.
  • a method for setting the number of bedrooms field; it should check for a reasonable input value.

(b)Create a Java class, 'Rentals', for managing a group of holiday homes that are available for rental. This class should have:

  • one field to store all the currently available holiday houses.
  • a constructor that initialises this field.
  • a method that takes a holiday house as an argument and removes it from the list.
  • a method that takes two holiday houses as arguments and returns the holiday house with the lowest monthly rent.

(c)Create a method, HolidaySeason, that takes two integers as parameters representing a month and day and that returns a String indicating the season for that holiday month and day. Assume that months are specified as an integer between 1 and 12 (1 for January, 2 for February, and so on) and that the day of the month is a number between 1 and 31. You should check that the inputs are within these bounds, but you are not required to check for invalid month, day combinations such as month=2 and day=30. Seasons are defined as: Spring (March, April, May), Summer (June, July, August), Autumn (September, October, November) and Winter (December, January, February).

  • Create five test cases to check the correctness of an implementation of this method.
  • Write Java code to implement the HolidaySeason method.
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.