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
The numeric keys on a keyboard or calculator are referred to as a:
Anna [14]

Numeric Keypad is the answer

6 0
3 years ago
Write a program to assist a cashier with determining correct change. The program should have one input, the number of cents to r
SCORPION-xisa [38]
```
#!/usr/local/bin/python3

import sys

coins = { "quarters" : 25, "dimes" : 10, "nickels" : 5, "pennies" : 1 }

def mkChange( balance, coin ):
    qty = balance // coins[ coin ]
    if( qty ):
        print( str( qty ) + ' ' + coin )
    return( balance % coins[ coin ] )

if( __name__ == "__main__" ):
    if( len( sys.argv ) == 2 ):
        balance = int( sys.argv[ 1 ] )
        balance = mkChange( balance, "quarters" )
        balance = mkChange( balance, "dimes" )
        balance = mkChange( balance, "nickels" )
        balance = mkChange( balance, "pennies" )
    else:
        sys.stderr.write( "\nusage: " + sys.argv[ 0 ] + " <change owed>\n" )
```


5 0
3 years ago
The marvelous attribute about the gaming industry is that you can create a game in several different programming languages to ma
LenaWriter [7]

Answer:

D syntax

Explanation:

The marvelous attribute about the gaming industry is that you can create a game in several different programming languages to make it more appealing to novice and advanced-level coders. Yet, the unique distinction is that every single programming language has its own syntax.

7 0
2 years ago
Until the 1990s scaling up was almost always a more cost-effective strategy to increase available computer power because communi
salantis [7]

Answer:

The answer is "Option A"

Explanation:

A single computer component also known as a single-board computer, it is a total machine, which is built on a single silicon chip with functional devices like microcontroller, (I / O), and storage.  

  • It normally uses a device, which has a fanless, small-power computation system, and small-profile design.
  • This model provides very slow communication between the components of single computers, that's why the given statement is true.

8 0
3 years ago
again assume that each of the resistors in the circuit shown above has a resistance value of 100k(question in the picture above)
Svetllana [295]
Statement A is true. R4 is not part of the circuit since it has one terminal not connected. The other resistors are in series, so the same current flows through them. Hence they will dissipate equal power.
4 0
3 years ago
Other questions:
  • I will give the brainly or whatever its called
    15·2 answers
  • All of the following except one are issues that should be covered in an AUP. Which one is the exception?
    5·1 answer
  • What are some local storage devices?​
    6·1 answer
  • What attack cracks a password or encryption key by trying all possible valid combinations from a defined set of possibilities (a
    12·1 answer
  • Dillard’s wants to learn about its consumers' attitudes toward online purchases. There are numerous studies that are available a
    9·1 answer
  • STEAM game launcher question.
    15·1 answer
  • A technician is building a thick client workstation that would be used to run a database and wants to ensure the best protection
    12·1 answer
  • Hydraulic pressure is the same throughout the inside of a set of brake lines. What determines the amount of resulting mechanical
    7·1 answer
  • After selecting multiple calendars, how do you view them in one single calendar? Open the Backstage view and then the Calendar o
    6·2 answers
  • I am trying to code a lifting simulator game on ro-blox. These problems listed in the third picture tells you the problems. If y
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!