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.


Q1: Write the Java code corresponding to the following UML diagram. The class School implements the<br>interface Building. The method computeArea returns the area of the building as width * length. After that,<br>add a testing class with a main method which defines an arrayList that contains three objects. From the<br>main method, print the area of all the three objects.<br>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: Q1: 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 « Interface >> + computeArea() : double + toString() : String School - classroomNum: int |- width: double |- length: double + School(classroomNum: int, width: double, length: double) + computeArea() : double + toString() : String

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here