Write the Java code corresponding to the following UML diagram. The class School implements the interface Building. The method computeArea returns the area of the building as width * length. After...


Write the Java code corresponding to the following UML diagram. The class School implements the interface Building. The method computeArea returns the area of the building as width * length. After that, add a testing class with a main method which defines an arrayList that contains three objects. From the main method, print the area of all the three objects.


Building<br>« Interface >><br>+ computeArea() : double<br>+ toString() : String<br>School<br>- classroomNum: int<br>- width: double<br>- length: double<br>+ School(classroomNum: int, width: double, length: double)<br>+ computeArea() : double<br>+ toString() : String<br>

Extracted text: Building « Interface >> + computeArea() : double + toString() : String School - classroomNum: int - width: double - length: double + School(classroomNum: int, width: double, length: double) + computeArea() : double + toString() : String

Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here