Question: WRITING METHODS 1. Implement a method named surface that accepts 3 integer parameters named width, length, and depth. It will return the total surface area

WRITING METHODS 1. 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.

2. Implement a method named rightTriangle that accepts 2 double arameters named sideA and hypotenuseB. The method will return the length of the third side.

NOTE: To test, you should put all of these methods into a MyMethods class and then write an application that will instantiate an instance (object) of that class to use the above methods. It should be obvious that you will need to get the parameters from either the user or through some other means (random number generator) so that when you call (invoke) the method you have the actual parameters to pass along to the method being called. If you do generate numbers have the application print them out so that you know what was generated and given to the method so that the return values can be checked for correctness.

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!