Question: In java programming: Refer to the above example and add constructors to Exercise 9 program. Compile and run the program. The program should contain constructors,
In java programming: Refer to the above example and add constructors to Exercise program. Compile and run the program. The program should contain constructors, inheritance of class, appropriate variable, type and methods. Take a screen capture of program code and output. Here is the exercise program code: class Area
double width;
double length;
print method
void showDim
System.out.printlnRoom dimension: length feet and width feet";
class Home extends Area
String room;
double area
return width length;
void showRoom
print room type method
System.out.printlnroom;
class House
public static void mainString args
create new instances
Home r new Home;
Home r new Home;
Home r new Home;
Home r new Home;
assign values to designated rooms
rwidth ;
rlength ;
rroom "Living Room";
rwidth ;
rlength ;
rroom "Master Bedroom";
rwidth ;
rlength ;
rroom "Kitchen";
rwidth ;
rlength ;
rroom "Dining Room";
print info
rshowRoom;
rshowDim;
System.out.printlnArea is rarea;
System.out.println;
rshowRoom;
rshowDim;
System.out.printlnArea is rarea;
System.out.println;
rshowRoom;
rshowDim;
System.out.printlnArea is rarea;
System.out.println;
rshowRoom;
rshowDim;
System.out.printlnArea is rarea;
System.out.println;
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
