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
uysha [10]
3 years ago
12

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/3
Base 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;
Physics
2 answers:
Maksim231197 [3]3 years ago
8 0

Answer:  Volume = 8/3

Explanation:

Let x represent the base length, base width and height  

Volume = 2x X 2x X 2x X 1/3 = 8x³/3

When x = 1.0

∴ Volume = 8(1.0)³/3 = 8/3

lara31 [8.8K]3 years ago
3 0

Answer:

Explanation:

Its not a good practice to write all the functions including main() in the same class.

But as you opted for this, the code goes here like this:

public class CalcPyramidVolume {

/* Your solution goes here */

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

{

double Volume,baseArea;

baseArea = baseLength * baseWidth;

Volume = baseArea * pyramidHeight * 1/3;

return Volume;

}

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;

}

}

And there is not caveat of integer division, as you are declaring all your variables of type double.

You might be interested in
Part 2: Design your own circuit (40 points)
Mrac [35]

Answer:

"YOUR OWN!"

Explanation:

8 0
2 years ago
What is the approximate efficiency of the engine?
Elodia [21]

Answer:91% I think

Explanation:

8 0
3 years ago
Read 2 more answers
The train 'A' travelled a distance is f 120 km in 3 hours , Whereas another train 'B' travelled a distance of 180 km in 4 hours
Radda [10]

Answer:

B train!

Explanation:

A train travelled at 40 km/hr. (120/3)

B train traveled at 45 km/hr (180/4)

6 0
3 years ago
Read 2 more answers
A lawyer drives from her​ home, located 88 milesmiles east and 1818 milesmiles north of the town​ courthouse, to her​ office, lo
myrzilka [38]

Answer:

the distance between the​ lawyer's home and her office is 124 miles

Explanation:

given information:

first lets assume that

x-axis (west = positive, east = negative)

y-axis (north = positive, south = negative)

thus,

distance of the house = (-88,18)

distance of the office = (13, -54)

thus, the distance between the​ lawyer's home and her office

R = √(x₂ - x₁)² + (y₂ - y₁)²

   = √(13 - (-88))² + (-54 -18)²

   = 124 miles

7 0
3 years ago
What are some examples of aerobic exercise?
Firdavs [7]

Answer:

swimming, cycling, and jogging

Explanation:

4 0
3 years ago
Other questions:
  • if you changed the direction of electron flow by switching the connections to the battery what would happen
    10·1 answer
  • T or F science is a continually evolving discipline
    15·2 answers
  • A particle with mass 1.81*10^-3kg and a charge of 1.22*10^-8C has, at a given instant, a velocity v= (3.0*10^4 m/s)j.
    13·1 answer
  • Colonist who belived in complete​
    13·1 answer
  • Que es entrenamientos físicos?
    9·1 answer
  • Power output of an engine is with work (w=60,000) during 60 s Calculate the power of this work?*
    15·1 answer
  • Energy cannot be created nor destroyed, only changed from one form to another. How does listening to music on a radio obey the l
    15·1 answer
  • Which statement BEST describes the first stages of cellular respiration? Select three options.
    12·2 answers
  • Buoyant force acts in the opposite direction as the force of
    14·1 answer
  • Acar start from rest and go with velocity of 4m/s for 4second what is acceleration of car​
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!