1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
hjlf
3 years ago
11

Define a method pyramidVolume with double parameters baseLength, baseWidth, and pyramidHeight, that returns as a double the volu

me of a pyramid with a rectangular base. Relevant geometry equations:Volume = base area x height x 1/3Base area = base length x base width.(Watch out for integer division)import java.util.Scanner;public class CalcPyramidVolume {/* Your solution goes here */public static void main (String [] args) {System.out.println("Volume for 1.0, 1.0, 1.0 is: " + pyramidVolume(1.0, 1.0, 1.0));return;}}

Computers and Technology
2 answers:
soldi70 [24.7K]3 years ago
7 0

Answer:

public class CalcPyramidVolume {

public static void main(String[] args) {

 // Test the method pyramidVolume() by printing out a test case

               // result.

 System.out.println("Volume for 1.0, 1.0, 1.0 is: " + pyramidVolume(1.0, 1.0, 1.0));

 return;

}

// Method name is pyramidVolume()

// It receives three parameters of type double - baseLength,

// baseWidth, and  baseHeight;

// It returns the calculated volume (which is of type double) of the

// pyramid  using the appropriate formula.

public static double pyramidVolume(double baseLength, double baseWidth, double baseHeight) {

 // From the parameters given, calculate the base area of the

              // pyramid first.

 double baseArea = baseLength * baseWidth;

 // From the base area, calculate the volume of the pyramid.

 // Note the use of 1 / 3.0 rather than 1 / 3. This is to bypass the

 // integer  division of 1/3 which will give zero(0).

 double volume = baseArea * baseHeight * 1 / 3.0;

 // Return the calculated volume

 return volume;

}

}

Explanation:

There are two versions to this code. The first one allows the user to enter the values for the length, width and height of the pyramid. The second version uses preset values for the length, breadth and height of the pyramid. The second version is represented in the answer above.

The source code files for the two versions have been attached to this response. Kindly download the files and go through the codes especially the comments. Every segment of the codes contains explanatory comments. Carefully go through these comments for explanation of the codes.

Hope this helps!

Download java
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark"> java </span>
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark"> java </span>
Vinil7 [7]3 years ago
4 0

Answer:

static double pyramidVolume(double baseLength, double baseWidth, double pyramidHeight){

  double Volume,baseArea;

  baseArea = baseLength * baseWidth;

  Volume = baseArea * pyramidHeight * 1/3;

  return Volume;

}

Explanation:

You might be interested in
Case Study/Scenario: First, Julio clicks Tools from the Chrome menu on the toolbar. Next, he looks for Manage Add-Ons but can no
Margarita [4]

Answer:

Follows are the solution to this question:

Explanation:

Throughout this scenario, Julio chooses the wrong way to handle the add-ons, instead, he opens the option to search and then type add-ons, where the manager can search for add-ons. It is a software extension that provides an application of additional features. It can broaden certain features, introduce additional features to just the interface surface, or provide extra capabilities for both the system.

4 0
3 years ago
Computers are often referred to as _____.
GalinKa [24]
Smart machines I'm pretty sure
4 0
2 years ago
Adding Web pages helps Web designers ___. Choose all answers that are correct.
ss7ja [257]

Answer:

B

Explanation:

7 0
2 years ago
¿Cómo es la onda percibida por un osciloscopio cuando hablamos de sonido? ¿Qué parámetros podemos observar en ella?
frozen [14]

Answer:

Las ondas de sonido, que es una onda longitudinal, son producidas por la vibración de un objeto de tal manera que (la onda de sonido requiere un medio de viaje, líquido sólido o gas) la dirección del sonido es la misma que la dirección de la vibración y como la el ancho de la vibración (hacia adelante y hacia atrás) aumenta, la amplitud de la vibración aumenta y el sonido es más fuerte

Un micrófono conectado al osciloscopio recoge el medio de aire vibrante de la onda de sonido de la energía de la onda de sonido y lo convierte (produce) señales eléctricas y electrónicas. El osciloscopio, que está diseñado para mostrar señales electrónicas, muestra las señales electrónicas transmitidas por el micrófono en la pantalla con los mismos valores de amplitud y frecuencia que el volumen y el tono de la onda de sonido, respectivamente.

Las características observables son;

1) El volumen o el volumen de la onda de sonido que se muestra como la amplitud) en el cátodo, con una amplitud más alta que representa un sonido más fuerte

2) El tono de la onda de sonido se muestra como el espaciado de onda en el osciloscopio, el sonido de tono más alto se muestra por las ondas que se acercan en la pantalla

Explanation:

7 0
3 years ago
Seth would like to make sure as many interested customers as possible are seeing his business’s website displayed in their searc
GenaCL600 [577]

Answer:

Hi! Make sure that the website has a few things. Proper Keywords, the pages have the proper tags, a form on the website, contact information, CIty State, Etc., Then a phone number. Social media icons that link properly to the social media pages.

Explanation:

5 0
3 years ago
Other questions:
  • Dfd symbols are referenced by using all ____ letters for the symbol name.
    9·1 answer
  • When tcp/ip was developed, the host table concept was expanded into a hierarchical name system for matching computer names and n
    5·1 answer
  • A ________ restricts the number of a certain type of product that can be imported into a country.
    5·1 answer
  • Answer these two if u can❤️
    5·2 answers
  • Boolean expressions are named after ____
    9·1 answer
  • I wonder how world is created
    12·2 answers
  • A technician needs to boot a PC from a USB drive.
    5·1 answer
  • Which programming language represents data in the form of a series of zeros and ones​
    7·1 answer
  • Choose all stages of the information processing cycle.
    12·2 answers
  • PLEASE PLEASE PLEASE PLEASE help me Im completly lost will give brainliest and 50 points
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!