Question: JAVA (b) Modify Question Q4(a)(ii) by adding an interface called Sides with method printside () and variable of squaresides with the initial value of 4.

JAVA

JAVA (b) Modify Question Q4(a)(ii) by adding an interface called Sides with

(b) Modify Question Q4(a)(ii) by adding an interface called Sides with method printside () and variable of squaresides with the initial value of 4. Create a program which demonstrates the use of interface sides in the subclass Square based on the requirement below: Sides interface: printSide(): a declaration of method Initializes squaresides variable with the given value of 4. Square subclass: Square (: The constructor sets height, width and figureType by calling the superclass constructor DetermineArea(): The method calculates an area of a square: area height * width] printside(): Print the number of side of the figure squareSides and call the Display() method from it's superclass. [8 marks) (b) Modify Question Q4(a)(ii) by adding an interface called Sides with method printside () and variable of squaresides with the initial value of 4. Create a program which demonstrates the use of interface sides in the subclass Square based on the requirement below: Sides interface: printSide(): a declaration of method Initializes squaresides variable with the given value of 4. Square subclass: Square (: The constructor sets height, width and figureType by calling the superclass constructor DetermineArea(): The method calculates an area of a square: area height * width] printside(): Print the number of side of the figure squareSides and call the Display() method from it's superclass. [8 marks)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!