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
9.
Svetllana [295]

Answer:

Explanation:

The following code is written in Java and it asks you for your age and then prints out the exact date from your birthday that you will turn 10,000 days old.

import java.util.Calendar;

import java.util.Date;

import java.util.Scanner;

public class Main {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("What is your age?");

       int age = in.nextInt();

       int daysLeft = (10000 - (age*365));

       Date birthday = new Date();

       Calendar cal = Calendar.getInstance();

       cal.setTime(birthday);

       cal.add(Calendar.DATE, daysLeft);

       Date modifiedDate = cal.getTime();

       System.out.println(modifiedDate);

   }

}

7 0
3 years ago
What is the slowest shutter speed?
crimeas [40]

Answer: I think the answer would be 1/30 or 1/60

Explanation: Anything below 1/90 is considered a soft image so i would go with 1/30 Brainliest ans plz.

7 0
3 years ago
Technician A says that OBDI and OBDII use different DLC connectors. Technician B says that OBDII standardizes the designations f
Ivenika [448]

Answer:

The answer is "Technician B"

Explanation:

The OBDII is a standardized, automated framework which the USA EPA had approved and installed into its whole year of modeling (MY) 1996 and then into modern light-duty vehicles and trucks, recognized as "on-board diagnostics II."  

  • The DTC framework is a set of problematic diagnostic codes that used alert you if a vehicle is unable to operate using an on-board Diagnostic System.
  • If the system of the automobile identifies a problem, a special DTC code is generated as well as a position sensor is sent to the instrument cluster, that's why Technician B is correct.
8 0
3 years ago
Please help me answering this question
Vanyuwa [196]

Answer:

none of them

Explanation:

the resistor is connected to the + pole of the battery, no circuit shows that.

a 1kΩ resistor would be brown-black-red, not brown black black.

8 0
2 years ago
In GIMP, the ( ) displays the image that the user is currently working on
kotykmax [81]
I don'r know what your trying to use? GIMP is a free photo editing software just upload it to photobucket.
7 0
3 years ago
Other questions:
  • Is anyone familiar in drawing flow charts for c++ programming
    14·1 answer
  • Advancement in technology is making peripherals...
    5·2 answers
  • A user has been given Full Control permission to a shared folder. The user has been given Modify permission at the NTFS level to
    11·1 answer
  • You can write as many constructors for a class as you want, as long as they all have different ____ lists.
    8·1 answer
  • A person who wants to buy a compact disc (cd) has just enough money to buy one, and chooses cd a instead of cd
    10·2 answers
  • Your team will write a function that reverses a C-string, to practice using pointers. You must use pointers and C-strings for th
    6·1 answer
  • Which of the following substances increases in quantity during repititive muscle contraction during oxygen deficti ?
    11·1 answer
  • ---------------------- use of the Internet to access programs and data on computers that are not owned and managed by the user o
    9·1 answer
  • In what ways are super computer different from mainframe computers.​
    10·1 answer
  • Does the source MAC address match your PC interface?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!