Question: 1. Write a class MyMethods containing the following 2 methods: a. a method named volume() that accepts 3 integer parameters named width, length, and height.
1. Write a class MyMethods containing the following 2 methods: a. a method named volume() that accepts 3 integer parameters named width, length, and height. The method returns the volume of the rectangular box it represents. For example, if parameter values are 2, 3, or 4, the method returns 24 b. a method named avgFaceValues that takes 2 Die objects as parameters (Use the Die class developed in class). The method returns the average face value of the two die objects. For example, if the first parameter is a Die object with a face value of 3 and the second parameter is a Die object with a face value of 4, the method should return 3.5. hamzaa.kalkann'in profil resmi 2. Write an application, TestMethods, that tests(invokes) the methods in problem 1. The program should instantiate an instance (object) of the class MyMethods and invoke the methods with made-up parameter data. 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
