Define a function calc_pyramid_volume with parameters base_length, base_width, and pyramid_height, that returns the volume of a pyramid with a rectangular base. Sample output with inputs: 4.5 2.1 3.0 Volume for 4.5, 2.1, 3.0 is: 9.45 Relevant geometry equations: Volume

Respuesta :

Answer:

Explanation:

The following is written in Java. It takes in the three values as parameters and then uses the formula for calculating the volume of a pyramid. Finally, returning the volume to the user. A test case has been provided in the main function and the output can be seen in the attached picture below.

class Brainly {

   public static void main(String[] args) {

       double output = calc_pyramid_volume(4.5, 2.1, 3.0);

       System.out.println(output);

   }

   public static double calc_pyramid_volume(double base_length, double base_width, double pyramid_height) {

       double volume = (base_length * base_width * pyramid_height) / 3;

       return volume;

   }

}

Ver imagen sandlee09