Question: 1. Implement a method named surface that accepts 3 integer parameters named width, length, and height. It will return the total surface area (6 sides)
1.
Implement a method named surface that accepts 3 integer parameters named width, length, and height. It will return the total surface area (6 sides) of the rectangular box it represents. The formula for Surface Area is 2(length * width) + 2(length * height) + 2(height * width). Sample input and output from driver run: Enter width: 2 Enter length: 3 Enter height: 4 The total surface area is: 52 2.
Implement a method named avgFaceValues that accepts 2 Die objects. Use the Die class developed in class. The method returns the average faceValue of the two die objects. For example, if die1 has face value 4 and die2 has face value 5, the method should return 4.5. 3.
To test methods above, create an application, TestMethods, that will instantiate an instance (object) of the class MyMethods to invoke the methods below. The application should have at least one invocation of each method.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
