Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Evaluation This assignment shall be graded A rubric has been created in Canvas that identifies building the criteria that shall be used to evaluate your

image text in transcribed
Evaluation This assignment shall be graded A rubric has been created in Canvas that identifies building the criteria that shall be used to evaluate your t reet NameStr Description Follow the steps below to complete this assignment. gStreetWunberOs String getstreetNane:String 1. Develop a solution that has three classes, as described in steps 2 through 4. The class diagram to the right shows the relationship between two of these classes. 2. Develop a class named building that has the following attributes and methods. a. Attributes thouse i. streetName-a String value that dentifies the name of the street this building is on. Any non-empty value is alowed for this attribute ii. streetNumber-a String value that contains the building's street number. Any non-empty value is allowed for this attribute. i yearBuilt- an int value that indicates the year the building completed construction. The year must be in the range [1975, 2019 b. Methods i. Constructor with three formal parameters-creates a building object by initializing the three attributes to their corresponding parameter variables i Default constructor-creates a building object by initializing each attribute to a value you deem appropriate ii. getStreetName)-returns this building's street name. iv. v. getYearBuilt) returns this building's year built. )-returns this building's street number. 3. Develop a class named house that has the following characteristics. a. A house is a buiIding b Attributes i. numberBathrooms- a double value that identifies the number of bathrooms in this house. This value must a number greater than zero with an optional fraction value of O.5. For example, 1.5 and 0.5 are valid values while 2.7 and 0.4 are not valid Page 1 of 2 CSC 176 Assignment S ii. numberBedrooms-an int value that identifies the number of bedrooms in this house. Any number greater than or equal to zero is valid C. Methods i. Constructor with five formal parameters- creates a house object by initializing the three building attributes and two house attributes to their corresponding parameter variables ii. Default constructor-creates a house object by initializing each attribute to a value you deem appropriate. ii. getNumberBathrooms)- returns this house's number of bathrooms iv. geNumberBedrooms)-returns this house's number of bedrooms. 4. Develop a class that contains a main method, and perhaps other methods, that use the building and house classes. The purpose of this class is to test the code in your building and house classes

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions