Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In OBJECT ORIENTED PROGRAMMING 1) public class MetBuilding { public int sqrFeet; private String name; BCS2143 Page 2 of 3 MODEL EXAM protected double cost;
In OBJECT ORIENTED PROGRAMMING
1) public class MetBuilding { public int sqrFeet; private String name; BCS2143 Page 2 of 3 MODEL EXAM protected double cost; public MetBuilding() {} protected boolean isBuilt {...} public void moveIn() { ... } public double rentSpace() {...} private int renovate(int days) {...} } a. Which members are visible to accessible from) MctBuilding and its subclasses? [1 mark] b. Which members are visible only to accessible from the MctBuilding class? [1 mark] c. Which members are visible to accessible from any class? [1 mark] d. For which field(s) we should write getter(s) and setter(s) for, so classes outside MetBuilding and its inheritance hierarchy can access it(them)? [1 mark] e. Write default constructor and what is its purpose? [1 Mark] f. Does default constructor return any value? Justify. [2 Marks) 2) Define the following terms used in Java? [8 Marks) a) this b) super c) final d) Lecture[] chapter 3) Write program for add, subtract, multiply, divide in a calculator applicationStep 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