Language is C++ Lab14A: 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 i.e., 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 this one and only exercise in Lab 14, 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: (in the two pictures)
Language is C++
Lab14A: 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 i.e., 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 this one and only exercise in Lab 14, 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: (in the two pictures)
![Next, create class Lab14A with a main method or driver which should do the following:
• Create two building objects:
o buildingOne should be created using the default constructor
o buildingTwo should be created using the overloaded (argument) constructor with the
values provided:
30 Stories
30 apartments
Occupancy variable set to 75% (0.75) – you may have to cast to float
You should then print out the information of buildingOne like the example shown below in the
sample using the getters
You should then print out the information of buildingTwo like the example shown below in the
sample using the getters
• Use the Setter of the occupancy percentage of buildingOne to change its value to 0% (0.0)
• Use the Setter of the occupancy percentage of buildingTwo to change it to 100% (1.0)
Remember, the name of the class containing the main method should be Lab14A. Please make
sure that your two classes (Lab14A and BuildingBlueprint) are in the one file
Please keep in mind that output of everyone should be the same and as shown below...
Sample (AND ONLY) output:
Year 2020:
Building 1 has 10 floors, 20 apartments, and is 100% occupied. Full? true
Building 2 has 30 floors, 30 apartments, and is 75% occupied. Full? false
Many years pass.
Year 2043:
Building 1 has 10 floors, 20 apartments, and is 0% occupied. Full? false
Building 2 has 30 floors, 30 apartments, and is 100% occupied. Full? true
Looks like people prefer taller buildings.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fe799f64b-1f0b-4ff1-9ee3-5090ddf07729%2Fbb6375ed-271f-45bf-9dab-d6fac32e001b%2Fscm9j3f_processed.png&w=3840&q=75)
![To start, you need to create class BuildingBlueprint, and it should have the following:
• Variables (Attributes):
o A variable that represents the number of stories the building has, this should be an
integer – must be private
o A variable that represents the number of apartments the building has, this should be an
integer – must be private
o A variable that represents the occupancy rate of the building (would contain numbers
between 0 and 1 representing the percentage of occupancy), this should be a float –
must be private
o 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 1 and
changes back to false if the occupancy falls to any value below 1, this should be a
Boolean - must be private
Constructors:
o A default constructor that when used creates a building object that has the following
default values
10 Stories
20 apartments
Occupancy variable set to 100% (1.0)
Fully Occupied variable set to true
o 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 1.0 .
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 full](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fe799f64b-1f0b-4ff1-9ee3-5090ddf07729%2Fbb6375ed-271f-45bf-9dab-d6fac32e001b%2F5y9iu4_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)