Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Q4 Answer Q4(a)-Q4(e) based on Figure Q4(a) and Figure Q4(b). Line 1 Code //House.java package myhome; LOCO public class House ! private int noofRoom; private
Q4 Answer Q4(a)-Q4(e) based on Figure Q4(a) and Figure Q4(b). Line 1 Code //House.java package myhome; LOCO public class House ! private int noofRoom; private int noofToilet; public double square Feet; 8 FIGURE Q4(a) Line Code // Semi Detached.java package myhome; 4 public class SemiDetached extends House { BOUWNE 7 8 9 public static void main(String[] args) { House myHouse = new House(); myHouse.noofRoom = 4; myHouse.noofToilet = 2; myHouse. square Feet = 3000.00; 11 FIGURE Q4(b) (a) Is the code at line 8 and 9 in SemiDetached.java is legit? Justify your answer. (3 marks) (b) Rewrite House.java at line 5 and 6 for the variables can be accessed from the same class, from the same package, and from a subclass in a different package. (2 marks) BREFEROHE 5) te) Based on the code you to 4) write prolonged Thom and secret to, 900.0rpeetiety (5 marks) Based on the code you have written in Q4(b), write a class named Bungalow that inherits House in a package named mysecondhome
Step 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