Question: Implement a method named surface that accepts 3 integer parameters named width, length, and depth. It will return the total surface area (6 sides) of

Implement a method named surface that accepts 3 integer parameters named width, length, and depth. It will return the total surface area (6 sides) of the rectangular box it represents.

heres my code so far:

public class HW3Methods

{

private double length, width, height;

public Surface(double l, double w, double h);

{

length = l;

width = w;

height = h;

double surfaceArea;

surfaceArea = (2 * length * height + 2 * length * width + 2 * height * width);

return surfaceArea;

}

}

and my testing file

public class hw3test

{

public static void main (String[]args)

{

HW3Methods test;

test = new Surface(2, 2, 2);

}

}

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!