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
cluponka [151]
3 years ago
7

Define a method calcPyramidVolume with double data type parameters baseLength, baseWidth, and pyramidHeight, that returns as a d

ouble the volume of a pyramid with a rectangular base. calcPyramidVolume() calls the given calcBaseArea() method in the calculation. Relevant geometry equations: Volume
Computers and Technology
1 answer:
Rudik [331]3 years ago
6 0

Answer:

import java.io.*;

public class Main {

   public static void main(String[] args) throws IOException {

       double baseLength = 0, baseWidth = 0, pyramidHeight = 0;

       Object[] volume;

       volume = calcPyramidVolume(baseLength, baseWidth, pyramidHeight);

   }

   public static Object[] calcPyramidVolume(double baseLength, double baseWidth, double pyramidHeight) {

       double area = calcBaseArea(baseLength, baseWidth);

       double volume = baseLength * baseWidth * pyramidHeight;

       return new Object[]{volume, area};

   }

   public static double calcBaseArea(double length, double width) {

       return length * width;

   }

}

Explanation:

The problem is flawed because it is completely inefficient for one to create two separate methods to calculate the volume and the area when they can be done at once.

The second problem is that it was never specified whether to return something from the calcBaseArea method.

I assumed it required it, so it is not advisable to initiate the method as a double, but rather create it as an Object so that it can return two values: the volume and the area.

You might be interested in
What is displayed on the console when running the following program?
Andre45 [30]

Answer:

The answer is "Option A"

Explanation:

In the given java code, a class "Test" is defined, inside the main method try and catch block is used, inside the try block method "p()" is called, that print a message. in this block two catch block is used, that works on "NumberFormatException" and "RuntimeException".  In the method "p" declaration, a string variable "s" is defined, that holds double value, that is "5.6", and converts its value into the wrong integer, and other wrong option can be described as follows:

  • In option B, it is wrong, it is not followed by after call method.
  • In option C, It is not followed by runtime exception, that's why it is incorrect.
  • Option D and Option E both were wrong because they can't give run time and compile-time error.  
6 0
3 years ago
Why is it good to be a computer programmer?​
liubo4ka [24]

Answer:

It's your wish become other professions like doctor, engineer are also good. But in this profession you can make apps, websites and can do hacking. Which is are cool things to do. But every profession is best at it's profession.

Explanation:

If you like my answer than please mark me brainliest

5 0
2 years ago
75,15,25,5,15 what's next
Fittoniya [83]

Answer:

3

Explanation:

The sequence seems to follow a 2-step pattern.

1)Divide the first number by 5 to get the second number.

2)Add 10 to the second number to get the third number.

75/5 = 15

15 + 10 = 25

25/5 = 5

5 + 10 = 15

---> 15/5 = [3] (Answer)

3 0
2 years ago
Which of the following is not hardware?
Pachacha [2.7K]

Answer:

A

Explanation:

I think it would be A because i have never heard of a virus scanner

6 0
2 years ago
What should a web page designer consider when choosing between fixed positioning and absolute positioning?
nexus9112 [7]

Answer:

Fixed positioning is relative to the browser window, while absolute positioning is located at a specific place on a web page.

7 0
3 years ago
Other questions:
  • I will give the brainly or whatever its called
    15·2 answers
  • Which of the following is not an element of the modified block style?
    7·2 answers
  • A browser is used for creating Web pages. true or false?
    5·2 answers
  • Sometimes news organizations have biasis because
    5·1 answer
  • !WILL MARK BRAINLIEST!
    8·1 answer
  • Which feature of spreadsheet software will make it easier for you to find the average number of calls made per hour for each emp
    15·1 answer
  • 22
    15·1 answer
  • Discuss the term internal control​
    12·1 answer
  • Which of the following is not a method for opening Word software?
    14·2 answers
  • SUB2 WWolfPlays on yt <br><br><br> true or false if false ima cri
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!