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
software that instructs the computer how to run applications and controls the display/keyboard is known as the
OverLord2011 [107]
<span>Operating System is the software that gives the computer instructions on how to run applications. It is considered the most important program that runs on a computer because it manages all the hardware and software on it. It also controls the display/keyboard. </span>
4 0
3 years ago
A string variable can hold digits such as account numbers and zip codes.<br><br> FALSE<br><br> TRUE
gavmur [86]
True. The second one is right
6 0
3 years ago
What is one invention that has had an impact on the way you live?<br><br>Write an essay
xz_007 [3.2K]
My phone duhhh. If I hadn’t had a phone I wouldn’t be able to send streaks...
8 0
3 years ago
Read 2 more answers
Which best describes what databases do?
quester [9]

Answer:

They create categories for data.

Explanation:

They can create categories for data, by storing the data. Information itself can be stored in multiple ways, like creating categories!

I hope this helped :)

6 0
3 years ago
Read 2 more answers
You have decided to install the DNS server role on Nano Server. What specific type of zone configuration is not supported when u
nadya68 [22]

Answer:Active Directory-integrated

Explanation: Active Directory-integrated is the service that is introduced by the Microsoft .This service provides the directory form for functioning in Windows. It serves the purpose of active directory(AD) transferring to the Dynamic web database. Whenever the user gets connected to any website, it provides validation to qualifications . So, it does not get support the specification when there is working of DNS.

4 0
3 years ago
Other questions:
  • Carmina wants to move a paragraph to the right margin of the document she is working in. She moves her cursor to
    8·2 answers
  • "You are setting up a new subnetwork on an existing network. Management has asked that you use existing cabling that the company
    14·1 answer
  • What kind of printers tend to have problems with ink drying out inside the nozzles when the printer is not used for a period?
    15·1 answer
  • Write an expression using membership operators that prints "Special number" if special_num is one of the special numbers stored
    12·1 answer
  • Why was Apple the best company of 2019??
    15·2 answers
  • Drawing programs typically create images using mathematical formulas, instead of by coloring pixels, so images can be resized an
    12·1 answer
  • What do we call data that's broken down into bits and sent through a network?
    15·1 answer
  • Alexa it is olewi.............................................
    15·2 answers
  • What sort of negative outcomes are possible for this type of risk?
    14·2 answers
  • The first version of Windows to have automatic updates from the Internet was _____.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!