Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need this for java programming Delline a class call it Room) that has two instance variables of float type representing the length and ota-The

I need this for java programming

image text in transcribed

Delline a class call it Room) that has two instance variables of float type representing the length and ota-The cass should have a public static varable of float type representing the number of rooms The class shouild have the tolicwing methots a. Default constructor that will initialce instance variables to o h. Constructor that will initialize the instance variables to the parameter values c The constructor should increment the static variable when an object of the class is defined or instantiated Accessors getlength, getwidth e Mutators setlength, setwidth set the length and width using the parameter value area) that will compute and return the area s perimeter) that will compute and return the perimeter h tosong0 that w retum, a string nicating lengt, width, area and perimeter Wirite a Java application to test the Rcom class above. Define several Room objects and make calls to the diferent methods write another class name iz House. A House object should have 5 Room objects (bedRooml, bedroom2 isingRoom ktchen and diningRoom) as instance variables. The class should include the following methods totaSprtl that will compute and return the total square feet for the house toStringo that will return a string representing the House object-rooms room areas and total square feet L setRoom0 that will set the information for a Room object using a Room object as a parameter with specified type for the room. The Room object will be updated based on the room type (bedRoom1, bedRoom2 livingRoom kitchen and diningRoom

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

Step: 3

blur-text-image

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

Graph Databases In Action

Authors: Dave Bechberger, Josh Perryman

1st Edition

1617296376, 978-1617296376

More Books

Students also viewed these Databases questions

Question

Types of Interpersonal Relationships?

Answered: 1 week ago

Question

Self-Disclosure and Interpersonal Relationships?

Answered: 1 week ago