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
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