Question: Lab 1 3 A: The Architect. Buildings can be built in many ways. Usually, the architect of the building draws up maps and schematics of
LabA: The Architect.
Buildings can be built in many ways. Usually, the architect of the building draws up maps and
schematics of a building specifying the building's characteristics such as how tall it is how many stories
it has, etc. Then the actual building itself is built based on the schematics also known as blueprints
Now it is safe to assume that the actual building is based off the blueprint but is not the blueprint itself
and vice versa
The idea of a classes and objects follows a similar ideology. The class file can be considered the
blueprint and the object is the building following the analogy mentioned above. The class file contains
the details of the object ie the object's attributes variables and behavior methods
Please keep in mind that a class is a template of an eventual object. Although the class has variables,
these variables lack an assigned value since each object will have a unique value for that variable.
Think of a form that you may fill out, for example, for a bank; this form has many boxes such as ones for
your first name, last name, etc. That form is analogous to a class; it's generic and does not have any
unique information. Once someone picks up the form and fills it out it becomes unique to that person
and is no longer a generic form; this is analogous to an object.
For the one and only exercise in Lab you will need to design a class and create objects from this
class in your main method. Please read and follow the instructions below carefully
To start, you need to create a class BuildingBlueprint, and it should have the following:
Variables Attributes:
A variable that represents the number of stories the building has. This should be an
integer must be private
A variable that represents the number of apartments the building has. This should be an
integer must be private
A variable that represents the occupancy rate of the building It contain numbers
between and representing the percentage of occupancy This should be a float
must be private
A variable that indicates if the building is fully occupied all the apartments have been
purchased which is only becomes true if the variable for the occupancy rate is and
changes back to false if the occupancy falls to any value below This should be a
Boolean must be private
Constructors:
A default constructor that when used creates a building object that has the following
default values:
Stories
apartments
Occupancy variable set to
Fully Occupied variable set to true
Overloaded Argument Constructor that should accept any value for the number of
stories, number of apartments and occupancy percentage. This constructor should
only set the fully occupied variable to true if and only if the provided occupancy
percentage is
Methods Behavior
o Getters and Setters for the occupancy rate variable
Getter for the number of stories variable
Getter for the number of apartments variable
Getter for the Boolean value of fullI
In java code please
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
