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
/*Implement a class Address . An address has a house number, a street, an optional
Ludmilka [50]

Answer:

Java.

Explanation:

public class Address {

   int houseNumber;

   String street;

   int apartmentNumber;

   String city;

   String state;

   int postalCode;

   public Address(int houseNumber, String street, String city, String state, int postalCode) {

       this.houseNumber = houseNumber;

       this.street = street;

       this.city = city;

       this.state = state;

       this.postalCode = postalCode;

   }

   public Address(int houseNumber, String street, int apartmentNumber, String city, String state, int postalCode) {

       this(houseNumber, street, city, state, postalCode);

       this.apartmentNumber = apartmentNumber;

   }

   public void printAddress() {

       System.out.printf("Street: %s%n", this.street);

       System.out.printf("City: %s, State: %s, Postal Code: %d.%n", this.city, this.state, this.postalCode);

   }

   public boolean comesBefore(Address other) {

       if (this.postalCode < other.postalCode) {

           return true;

       }

       else {

           return false;

       }    

   }

}

The few changes I made are in bold.

8 0
3 years ago
In every organization, workers receive and sendinformation daily. The flow of this information should be____________.upward and
Aleks [24]

Answer:

upward and downward

Explanation:

4 0
3 years ago
Is there an air flow through the house? if so, does the air flow in the window and out the chimney, or in the chimney and out th
soldier1979 [14.2K]

The correct explanation is option B. The pressure is reduced at the chimney due to the movement of the wind above. Thus, the air will flow in the window and out the chimney.

<h3>What is the main purpose of chimney?</h3>

The primary work of the chimney is to show the way that the smoke need to take away from the stove and also out of the house.

Hence, The correct explanation is option B. The pressure is reduced at the chimney due to the movement of the wind above. Thus, the air will flow in the window and out the chimney.

Learn more about chimney from

brainly.com/question/24792291

#SPJ1

See full question below

Is there an air flow through the house? If so, does the air flow in the window and out the chimney, or in the chimney and out the window? Choose the correct explanations.

A. The pressure is increased at the chimney due to the movement of the wind above. Thus, the air will flow in the chimney and out the window.

B. The pressure is reduced at the chimney due to the movement of the wind above. Thus, the air will flow in the window and out the chimney.

C. The pressure is increased at the chimney due to the movement of the wind above. Thus, the air will flow in the window and out the chimney.

D. The pressure is reduced at the chimney due to the movement of the wind above. Thus, the air will flow in the chimney and out the window.

E. The pressures at the chimney and the window are the same. Thus, the air will not flow.

5 0
1 year ago
By default the normal style inserts a vertical space equal to _____ lines between each line of text
nika2105 [10]
By default the normal style inserts a vertical space equal to 1.5 size vertical   lines between each line of text.
3 0
3 years ago
A tool that is used to search for and gather data from a page on the internet is called a ?
pshichka [43]
It is called a sesrc engine
8 0
3 years ago
Read 2 more answers
Other questions:
  • Trisha is looking for a new table style. What is the fastest way for her to preview how different styles in the gallery would lo
    13·1 answer
  • What is a custom information field that helps users to find a specific document?
    8·1 answer
  • The device used to connect a network to the internet is called a
    7·1 answer
  • Organizing speech ideas according to physical space, direction, or location calls for a _____ organizational pattern.
    11·1 answer
  • Outline four types of cyber law.
    14·1 answer
  • 35 POINTS
    10·1 answer
  • Write a program that calculates the average of N integers. The program should prompt the
    12·1 answer
  • The full meaning of UNIVAC and ENIAC​
    5·2 answers
  • what is the importance of familiarizing and understanding the cells rows and format tools in the microsoft cell​
    9·1 answer
  • What is the basic body structure of html.
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!