Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Spatial Databases 2nd Symposium Ssd 91 Zurich Switzerland August 1991 Proceedings Lncs 525

Authors: Oliver Gunther ,Hans-Jorg Schek

1st Edition

3540544143, 978-3540544142

More Books

Students also viewed these Databases questions

Question

Evaluate the importance of the employee handbook.

Answered: 1 week ago

Question

Discuss the steps in the progressive discipline approach.

Answered: 1 week ago