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 fair use?
koban [17]

Answer:

I believe its C

Explanation:

I'm sorry if its wrong...

8 0
4 years ago
Read 2 more answers
What is the binary number system? ​
Scilla [17]
DescriptionIn mathematics and digital electronics, a binary number is a number expressed in the base-2 numeral system or binary numeral system, which uses only two symbols: typically "0" and "1". The base-2 numeral system is a positional notation with a radix of 2. Each digit is referred to as a bit.
6 0
3 years ago
Describe the role of a chemist and the role of a chemical engineer
Andreas93 [3]
Chemist is chemist research and experiments

Chemical engineer is engineers concerned with the design and operation of industrial chemical plant
3 0
4 years ago
Give me your 3ds friend code :)
Karolina [17]

You can friend me mine is- 3024-6635-0458

4 0
4 years ago
*
asambeis [7]

Answer:

I think they're all valid but the validility depends on the website your using the usernames on.

Explanation:

6 0
3 years ago
Other questions:
  • Which statements about Excel's FV function are correct?
    13·1 answer
  • ?the single most effective security measure for digital devices is to password protect access to them.
    5·1 answer
  • Which statement is a famous quote from Canadian Communications theorist Marshall mcluhan​
    9·1 answer
  • Find the simple interest Jay owes on a five-year student loan of $48,000 with an annual interest rate of 5%.
    9·1 answer
  • Mass Media does not play a large role in American society. Please select the best answer from the choices provided
    13·2 answers
  • Which of the following situations represent(s) resource scarcity? I. Rapidly growing economies experience increasing levels of w
    9·1 answer
  • Which line of code will print Python is cool! on the screen?
    9·2 answers
  • categorize each job role as an administrative job or management job auditor director legal secretary payroll clerk etc ​
    8·1 answer
  • After inserting a video into your slide how can you test it
    11·1 answer
  • Pick the correct statements on the 64-bit machine representation of numbers.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!