Question: undefined Problem 2: Building and Building Tester Write a program that meets the following requirements: Building class 1. Your application keeps track of unsafe buildings.


undefined
Problem 2: Building and Building Tester Write a program that meets the following requirements: Building class 1. Your application keeps track of unsafe buildings. Create a class called Building which has only the following instance variables (use these names for your instance variables): name (String) architect (String) yearBuilt (int) yearCondemned (int) 2. Create the no-argument/zero param constructor. Set the name to building name Set the architect to TBD Set the yearBuilt to the current year. To get the current year import the Calendar class and use the following line of code: Calendar.getInstance().get(Calendar. YEAR); //this will give you the current year Set the yearCondemned to the current year. 3. Create the constructor which uses all fields as parameters. 4. Write the getter and setter methods for all instance variables. 5. Create a custom instance method with the following signature: public int findBuildingAge() //To get the age of building, subtract the year built from the year condemned if yearBuilt and yearCondemned are the same, age of building is (0) - do not worry about the month -- this gets complicated 6. Create a custom instance method with the following signature: public String getNameInUppercase() 1/return the building's name in all uppercase letters. The method to do this is found in the String class 7. Write the toString method ensure that it displays all 4 instance variables, the age of the building and the name in uppercase. 8. There should be NO main method in the Building class. Building Tester Class 1. Create a class called Building Tester which constructs 4 different Building objects. Ensure that you test both constructors. 2. Print out each Building Notes: Watch your time. Late submissions NOT accepted. Submit.java files with the class names of ScannerInput, Building and Building Tester The only comments required are header comments Ensure that your code compiles
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
