Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write the three parts below as separate classes within the same project. - Write

ID: 658490 • Letter: W

Question

Write the three parts below as separate classes within the same project.

- Write a Java class called Garage that stores the size, how many cars can fit, as an integer. The class should also store numDoorsas an integer representing how many overhead doors the garage has. Provide a two parameter constructor that allows the twocomponents of a Garage to be initialized. In addition, provide accessors and mutators for all instance variables.

- Write a Java class called Address that stores the street, city, state and zip of an address as separate Strings. Provide a constructor that initializes all instance variables. In addition, provide accessors and mutators for all instance variables.

- Write a Java class called House that stores the details of a student. This class must have an instance variable that stores thecolor as a String. This class also stores a numBedrooms integer representing the number of bedrooms in the house. In addition, the class has two other instance variables, garage that is an instance of Garage, and address that is an instance of Address. Provide a constructor that allows these four components to be initialized. In addition, provide accessors and mutators for all theinstance variables.

Explanation / Answer

import java.io.*; public class Temp { public static void main(String[] args) throws IOException { BufferedReader input= new BufferedReader(new InputStreamReader(System.in)); int minutesstayed; System.out.println("Welcome to NO DENTS PARKING GARAGE"); System.out.println(); System.out.println("How long did you park for (in minutes)"); minutesstayed=Integer.parseInt(input.readLine()); double charge=0.75*(minutesstayed/60); System.out.println("Your Parking Fee is:"+" "+charge); } }