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
hjlf
3 years ago
11

Define a method pyramidVolume with double parameters baseLength, baseWidth, and pyramidHeight, that returns as a double the volu

me of a pyramid with a rectangular base. Relevant geometry equations:Volume = base area x height x 1/3Base area = base length x base width.(Watch out for integer division)import java.util.Scanner;public class CalcPyramidVolume {/* Your solution goes here */public static void main (String [] args) {System.out.println("Volume for 1.0, 1.0, 1.0 is: " + pyramidVolume(1.0, 1.0, 1.0));return;}}

Computers and Technology
2 answers:
soldi70 [24.7K]3 years ago
7 0

Answer:

public class CalcPyramidVolume {

public static void main(String[] args) {

 // Test the method pyramidVolume() by printing out a test case

               // result.

 System.out.println("Volume for 1.0, 1.0, 1.0 is: " + pyramidVolume(1.0, 1.0, 1.0));

 return;

}

// Method name is pyramidVolume()

// It receives three parameters of type double - baseLength,

// baseWidth, and  baseHeight;

// It returns the calculated volume (which is of type double) of the

// pyramid  using the appropriate formula.

public static double pyramidVolume(double baseLength, double baseWidth, double baseHeight) {

 // From the parameters given, calculate the base area of the

              // pyramid first.

 double baseArea = baseLength * baseWidth;

 // From the base area, calculate the volume of the pyramid.

 // Note the use of 1 / 3.0 rather than 1 / 3. This is to bypass the

 // integer  division of 1/3 which will give zero(0).

 double volume = baseArea * baseHeight * 1 / 3.0;

 // Return the calculated volume

 return volume;

}

}

Explanation:

There are two versions to this code. The first one allows the user to enter the values for the length, width and height of the pyramid. The second version uses preset values for the length, breadth and height of the pyramid. The second version is represented in the answer above.

The source code files for the two versions have been attached to this response. Kindly download the files and go through the codes especially the comments. Every segment of the codes contains explanatory comments. Carefully go through these comments for explanation of the codes.

Hope this helps!

Download java
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark"> java </span>
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark"> java </span>
Vinil7 [7]3 years ago
4 0

Answer:

static double pyramidVolume(double baseLength, double baseWidth, double pyramidHeight){

  double Volume,baseArea;

  baseArea = baseLength * baseWidth;

  Volume = baseArea * pyramidHeight * 1/3;

  return Volume;

}

Explanation:

You might be interested in
Which is NOT a component of a relationaldatabase?
MaRussiya [10]

Answer: 4) Hierarchy

Explanation:

The main components of the relational database are table, entity and attributes. As, relational data base is the method of arranging and maintaining the data and each table in the database contain data in the entity and the attributes. Hierarchy is not the component of the database as it is included in the type oh hierarchical database not in relational database.

5 0
4 years ago
What is an inode number? Group of answer choices A number that is associated with the file and unique in that particular filesyt
gregori [183]

An Inode number is a number that is related to the file and unique across all file systems in Linux and Unix.

A number that is associated with the file and unique in that particular filesytem.

<u>Explanation:</u>

Whenever any files are created on the system, It is given a file name with a number (inode)is unique. To access this file on the system, the user usually will use the file name. But here, he or she will have to access the file along with an Inode number associated with it.

Where stored as numbers datatype in a table called the Inode table. The Inode table is created only when the file system is created. It shows how many inodes are filled and how many are free. The command “df-i” shows the inode table in Linux

8 0
3 years ago
It is a science fiction but the answer is not science fiction.it States ;it's inventiveness,uncertainly and futuristic ideas typ
MAVERICK [17]

Answer:

The uncertainty of inventiveness and futuristic ideas usually deal with science and technology.

Inventibility is something uncertain which promotes a risk in any system in which it is inserted. With that, we can naturally associate it with the maintenance of science and technology, because both are in need of inventing new creations, which may or may not be effective for the defeat of uncertainties and the creation of certainties.

This is usually linked to futuristic ideas, which may not fit in today's society, but which impose improvements, or not, for societies in the future. Leading to the creation of more technologies and more sciences.

3 0
3 years ago
What is the “data” in an SRS's data flow diagram?
mezya [45]

Answer:

a is the answer

pa brainliest po

7 0
2 years ago
Suppose that an instructor assigns different letter grades based on points earned on a 10-point quiz, and that all scores have b
xeze [42]

Answer:

three

Explanation:

Since there are four grades to be represented, any three letter grades can correspond, with a one-to-one mapping, to the elements in the numeric array. Any point that is not represented can be given to the fourth letter grade.

This is also possible because it has been verified that all scores are between 0 and 10. Not more.

Hope this helps!

6 0
4 years ago
Other questions:
  • list the network characteristics of the wireless network(s) in the decode -- SSIDs, channels used, AP names, presence of Bluetoo
    6·1 answer
  • How many bits must be "flipped" (i.e., changed from 0 to 1 or from 1 to 0) in order to capitalize a lowercase that’s represented
    13·2 answers
  • ALGUEM SABE COMO MUDA O NOME DE PERFIL!?!?!? SE SOUBER ME AJUDA!!
    14·1 answer
  • Suppose a reference variable of type Double called myDouble has already been declared. There is also a double variable x that ha
    13·1 answer
  • The Task Manager can be used ot track running _________________ .
    11·1 answer
  • For which is a chart legend used?
    8·1 answer
  • What should the shutter speed be on the camera?<br> A. 1/30<br> B. 1/50<br> C. 1/60<br> D. 1/15
    9·1 answer
  • Ano ang dalawang paraan sa paggawa ng abono?​
    6·1 answer
  • Film’s importance in today’s economy?
    12·1 answer
  • Write a program in c# that simulates the roll of two six sided dice.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!