Question
. The International Building Code (IBC) requires that all buildings and structures be classified by group and occupancy according to the follow specifications: Table 1:
. The International Building Code (IBC) requires that all buildings and structures be classified by group and occupancy according to the follow specifications: Table 1: IBC Building Codes OCCUPANCY GROUP Assembly Business Educational Factory/Industrial High Hazard Institutional Mercantile Residential Storage Utility & Miscellaneous SUBGROUPS Groups A-1, A-2, A-3, A-4, & A-5 Group B Group E Groups F-1 & F-2 Groups H-1, H-2, H-3, H-4, & H-5 Groups I-1, I-2, I-3, & I-4 Group M Groups R-1, R-2, R-3, & R-4 Groups S-1 & S-2 Group U USES INCLUDE Gatherings civic/religious/social/recreational Office/Professional or Service Transactions K-12 Schools (some Daycare) Manufacturing/Fabrication/Packaging Hazardous Materials Assisted Living/Hospitals/Prisons Display & Sale of Merchandise Housing/Apartments/Hotels Non or Low-Hazardous Storage (including parking garages) Accessory Structures A local architecture firm has asked your company to develop a mapping application for all of its projects. Your Software Architecture Team has drafted the following UML Class Diagram with only two occupancy groups (Business and Residential) with which to get started. Figure 1: UML Class Diagram for Construction Program
Using the UML Class Diagram write a prototype for the system with the following specifications: 1. Building class: this is the superclass for all objects in our system. It contains the following instance members/constructors/methods: a. projectName the name of the building project e.g. Gaines House. b. completeAddress the complete address of the project e.g. 123 Main Street, Louisville, Kentucky 40201. c. totalSquareFeet the square footage of the building (e.g. 2,450 square feet) d. occupancyGroup group code according to Table 1. e. subgroup subgroup code according to Table 1. f. Constructors there are two constructors. An empty-argument constructor that should set all instance fields to or 0.0 as appropriate. The preferred constructor should support passing parameters for each instance field. g. draw method eventually this will be used to draw the object to the screen. For the prototype, it will simply print to the console: Drawing code for >. All of the draw methods in the subclasses will do the same. h. displayData method will return a formatted String that contains all of the information about the object. 2. Business class: this subclass of Building has the following instance members/constructors/methods: a. numRentableUnits the number of units in the building that can be rented. b. Constructors there are two constructors. An empty-argument constructor that should set all instance fields as appropriate for the data type. The preferred constructor should support passing parameters for each instance field. c. draw method eventually this will be used to draw the object to the screen. For the prototype, it will simply print to the console: Drawing code for >. All of the draw methods in the subclasses will do the same. d. displayData method will return a formatted String that contains all of the information about the object. 3. Mall class: this subclass of Business has the following instance members/constructors/methods: a. numRentedUnits the number of units in the building that are currently being rented. b. medianUnitSize the mall contains rentable units of different size. This instance member represents the median of all of the unit sizes. c. numParkingSpaces the total number of parking spaces around the mall. d. Constructors there are two constructors. An empty-argument constructor that should set all instance fields as appropriate for the data type. The preferred constructor should support passing parameters for each instance field. e. draw method eventually this will be used to draw the object to the screen. For the prototype, it will simply print to the console: Drawing code for >. All of the draw methods in the subclasses will do the same. f. displayData method will return a formatted String that contains all of the information about the object. 4. Residential class: this subclass of Building represents a building where people can live (has bedrooms and bathrooms) and has the following instance members/constructors/methods: a. numBedrooms the number of bedrooms in the building. b. numBathrooms the number of bathrooms in the building. c. laundryRoom whether or not the building has a laundry room. d. Constructors there are two constructors. An empty-argument constructor that should set all instance fields as appropriate for the data type. The preferred constructor should support passing parameters for each instance field. e. draw method eventually this will be used to draw the object to the screen. For the prototype, it will simply print to the console: Drawing code for . All of the draw methods in the subclasses will do the same. f. displayData method will return a formatted String that contains all of the information about the object. 5. Apartment class: this subclass of Residential represents a building where more than one family can live and has the following instance members/constructors/methods: a. numRentableUnits the number of units that can be rented in the building. b. avgUnitSize the average size of the apartments (square footage) in the building. c. parkingAvailable a boolean value that indicates if onsite parking is available for this building. d. Constructors there are two constructors. An empty-argument constructor that should set all instance fields as appropriate for the data type. The preferred constructor should support passing parameters for each instance field. e. draw method eventually this will be used to draw the object to the screen. For the prototype, it will simply print to the console: Drawing code for >. All of the draw methods in the subclasses will do the same. f. displayData method will return a formatted String that contains all of the information about the object. 6. SingleFamilyHome class: this subclass of Residential represents a building where a one family lives (has a limit on the number of people who can live there). This class has the following instance members/constructors/methods: a. garage a boolean value that indicates whether or not the house has a garage. b. Constructors there are two constructors. An empty-argument constructor that should set all instance fields as appropriate for the data type. The preferred constructor should support passing parameters for each instance field. c. draw method eventually this will be used to draw the object to the screen. For the prototype, it will simply print to the console: Drawing code for >. All of the draw methods in the subclasses will do the same. d. displayData method will return a formatted String that contains all of the information about the object. 7. Application class: After you have completed your inheritance hierarchy, write an Application class (not shown in the UML Class Diagram) to test every object. In your test, create an instance of every object and then write code to test every constructor/method/getter/setter/toString for the object. Start with the most generic object and move to the more specific object. 8. Mid-project code review: Upload the Github link to your partially completed project on the assigned date. Theres a Project 2 Draft Submission assignment dropbox in Moodle. Notes: 1. Notice that every class has constructor that accepts the protected fields in Building (for consistency). 2. There is an empty-argument and a preferred constructor for each object. (Use the tools built into Eclipse to generate these) 3. Every object should have getters/setters for every instance field. (Use the tools built into Eclipse to generate these) 4. Every object should have a toString method (Use the tools built into Eclipse to generate these) 5. Ensure you follow the StyleGuide and fully comment/Javadoc the project. 6. Some objects have a displayData method. When that method is called it should return a formatted string with all of the instance fields that the object can see. The format needs to be consistent from object to object, but you can choose the format. See below for examples: Building SingleFamilyHome Project Name: Gaines House Address: 123 Main Street | New York, Neyyork 40201 Square Feet: 2540 Occupancy Group :Residential Occupancy Subgroup: R1 Project Name: Gaines House Address: 123 Main Street | Louisville, Kentucky 40201 Square Feet: 2540 Occupancy Group :Residential Occupancy Subgroup: R1 Number of Bedrooms: 4 Number of Bathrooms: 3 Laundry Room: Y Garage: Y Submission:
Building #projectName: String #completeAddress: String #totalSquare Feet: double #occupancyGroup: String #subgroup: String +Building) +Building/String projectName, String complete Address, double totalSquareFeet, String occupancyGroup, String subgroup) +draw(); void +displayData(): String Residential Business #numRentableUnits: int +Business +Business(String projectName, String completeAddress, double totalSquareFeet, String occupancyGroup, String subgroup) #num Bedrooms: int #num Bathrooms: Int #laundry Room:boolean Residential +Residential(String projectName, String complete Address, double totalSquare Feet, String occupancyGroup, String subgroup) Mall Apartment SingleFamily Home -numRentedUnits -median UnitSize: double -numParking Spaces: int +Mall) +Mall(String projectName, String completeAddress, double totalSquare Feet, String occupancyGroup, String subgroup) #draw(); void +displayData(): String -numRentableUnits: int -avgUnitSize: double -parking Available: boolean +Apartment() +Apartment(String projectName, String complete Address, double totalSquareFeet, String occupancyGroup, String subgroup) draw(): void +displayData(): String -garage: boolean +SingleFamilyHomel) +Single Family Home(String projectName, String complete Address, double totalSquare Feet, String occupancyGroup, String subgroup) +draw(): void +displayData(): String Building #projectName: String #completeAddress: String #totalSquare Feet: double #occupancyGroup: String #subgroup: String +Building) +Building/String projectName, String complete Address, double totalSquareFeet, String occupancyGroup, String subgroup) +draw(); void +displayData(): String Residential Business #numRentableUnits: int +Business +Business(String projectName, String completeAddress, double totalSquareFeet, String occupancyGroup, String subgroup) #num Bedrooms: int #num Bathrooms: Int #laundry Room:boolean Residential +Residential(String projectName, String complete Address, double totalSquare Feet, String occupancyGroup, String subgroup) Mall Apartment SingleFamily Home -numRentedUnits -median UnitSize: double -numParking Spaces: int +Mall) +Mall(String projectName, String completeAddress, double totalSquare Feet, String occupancyGroup, String subgroup) #draw(); void +displayData(): String -numRentableUnits: int -avgUnitSize: double -parking Available: boolean +Apartment() +Apartment(String projectName, String complete Address, double totalSquareFeet, String occupancyGroup, String subgroup) draw(): void +displayData(): String -garage: boolean +SingleFamilyHomel) +Single Family Home(String projectName, String complete Address, double totalSquare Feet, String occupancyGroup, String subgroup) +draw(): void +displayData(): StringStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started