Question: Java exercise: Return volume as a value (not String) from a method which has 3 parameters 1) Write a program which passes 3 integer arguments
Java exercise:
Return volume as a value (not String) from a method which has 3 parameters
1) Write a program which passes 3 integer arguments (height, width, length) into a method vol(...) .
2) The above method then computes the volume, and returns the volume to the main( ).
3) Show all related values on the screen.
For example, if the sides are 3 by 3 by 6, then your output should be something like: "the volume of a 3x3x6 is 54 cubic feet." Remember: the volume must be returned from a method with 3 parameters.
So, to call the method from the main, one would write something resembling: v = vol(sideA, sideB, sideC);
where all variables above are of the "integer" data type.

class Add int sum(int numi, int num2) return nun1 + num2; public static void main(String[] args) Add add = new Add(); System.out.println("1 + 2 = " + add sum(1,2))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
