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
During what era did the French and Indian War occur?
Thepotemich [5.8K]
<span>French and Indian War began in 1754 and ended with the Treaty of Paris in 1763. The war provided Great Britain enormous territorial gains in North America, but disputes over subsequent frontier policy and paying the war’s expenses led to colonial discontent, and ultimately to the American Revolution.</span>
7 0
3 years ago
Read 2 more answers
Mention the name of the following frequencies depending upon their values a) 12Hz b) 20100Hz
Kaylis [27]
It can be a) 12Hz.................
5 0
3 years ago
Which is a characteristic of all waves?
juin [17]

Answer:à

Explanation:waves carry energy in the direction in which they move

7 0
3 years ago
Read 2 more answers
a girl performed 50j of work lifting a heavy box it took her 5 seconds to lift the box what is her power
son4ous [18]

Answer:

10 W

Explanation:

Power is work over time.

P = W / t

P = 50 J / 5 s

P = 10 W

3 0
3 years ago
Which of the following is a fundamental quantity?
Yuki888 [10]

-- Volume . . . made out of 3 dimensions of length

-- Density . . . made out of mass, and 3 dimensions of length

-- Area . . . made out of 2 dimensions of length

-- Acceleration . . . made out of length and time

<em>Mass</em> is not made out of anything else.  It's fundamental.  A few other fundamental things are length, time, and electric charge.

7 0
3 years ago
Read 2 more answers
Other questions:
  • A slide inclined at 35 takes bathers into a swimming pool. with water sprayed on the slide the bathers spends only one third as
    10·1 answer
  • Which of these chemical equations demonstrates the law of conservation of mass as it applies to the combustion of ethane? A. 2 C
    14·1 answer
  • A science class puts a balloon containing 1.25 l of air at 101 kpa into a bell jar. using an air pump, the class removes some of
    13·1 answer
  • An object weighs 100 newtons on earth's surface when it is moved to a point one earth radius above earth's surface it will weigh
    10·2 answers
  • Can someone please helpppp meeeeeee
    13·2 answers
  • 1. (3 points) Convert the given distances to kilometers using the
    13·1 answer
  • A 80 kg parent and a 20 kg child meet at the center of an ice rink. They place their hands together and push. The parent pushes
    10·1 answer
  • Car B is rounding the curve with a constant speed of 54 km/h, and car A is approaching car B in the intersection with a constant
    6·1 answer
  • 1. Consider the position vs time graph at right.
    6·1 answer
  • HELP ME OUT PLEASE!!!!!
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!