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
Scripting languages are unique computer languages with a specialized function. explain what scripting languages do, and how this
yarga [219]

Scripting languages are unique computer languages because they automate task that could be done by human operator and are easy to use.

<h3>What is a scripting language?</h3>

Scripting languages are programming languages that is interpreted.

They are programming languages that automates the task that will originally be performed by a human operator.

Scripting languages are used to give instruction to other software to run accordingly to how you want it.

The scripting language is different form other language base on the fact that its interpreted . This means the code are translated to machine code when it is run.

The major advantage of scripting languages is that it is human readable and understandable.

Examples of scripting languages are Python and JavaScript.

learn more on scripting here: brainly.com/question/12763341

#SPJ1

3 0
2 years ago
You recently created several new user accounts in the Sales OU and configured them with the appropriate group membership, logon
irga5000 [103]

Answer:

Disable the account until the employee is ready to use it.

Explanation:

6 0
3 years ago
A portable electronic device that can be used in an emergency to stop someone’s heart from going out of rhythm is called a/an
JulsSmile [24]
It is called a Heart pace maker
7 0
3 years ago
Read 2 more answers
Research online and identify two online plagiarism checker tools. Choose such tools that you can use for writing your schoolwork
LenaWriter [7]

This is an essay question, not fit for Brainly - please remove. There is a plagiarism checker by both Grammarly and Quetext, use those to help find your answer.

4 0
4 years ago
Jasper, a businessperson, has no connection with Yale University, but he has a new line of computer software that he would like
zheka24 [161]

Answer:

The answer is letter D.

Explanation:

It is unlikely that Jasper will be able to register the name "Yale Software," because it falsely suggests a connection to an institution.

3 0
4 years ago
Other questions:
  • Two users, UserA and UserB, are engaging in secure communication using only asymmetrical encryption. UserA needs to send a secur
    11·1 answer
  • What technical elements can a film director manipulate to achieve the final product, conveying his ideology and vision?
    11·1 answer
  • When a fighter pilot crosses into the airspace of another country without permission it can be considered an act of aggression o
    8·1 answer
  • Build a state diagram for the “book” based upon the following information of the library.
    6·1 answer
  • Package hw1;
    10·1 answer
  • 5-16) (Bar Chart Printing Program) One interesting application of computers is to display graphs and bar charts. Write an applic
    10·1 answer
  • What would be used by a business to assess how the business is working within its organization goals? O A. Information systems B
    8·1 answer
  • Define a toString prototype method that returns the cat's name, gender, and age separated by semicolons.
    8·1 answer
  • Select all steps in the list below that should be completed when using the problem-solving process discussed in this chapter.
    14·1 answer
  • Alina is using a small database that uses just one table to store data. What type of database is Alina using?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!