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
Pachacha [2.7K]
4 years ago
15

Define a function PyramidVolume with double parameters baseLength, baseWidth, and pyramidHeight, that returns as a double the vo

lume 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).#include /* Your solution goes here */int main(void) {printf("Volume for 1.0, 1.0, 1.0 is: %.2f\n", PyramidVolume(1.0, 1.0, 1.0) );return 0;}

Engineering
2 answers:
adoni [48]4 years ago
6 0

Answer:

The problem demands a function PyramidVolume() in C language since printf() command exists in C language. Complete code, output and explanation is provided below.

Code in C Language:

#include <stdio.h>

double PyramidVolume(double baseLength, double baseWidth, double pyramidHeight)

{

return baseLength*baseWidth*pyramidHeight/3;

}

int main()

{

  printf("Volume for 1.0, 1.0, 1.0 is: %.2f\n",PyramidVolume(1, 1, 1));

  printf("Volume for 2.5, 5, 2.0 is: %.2f\n",PyramidVolume(2.5, 5, 2.0));

return 0;

}

Output:

Please also refer to the attached output results

Volume for 1.0, 1.0, 1.0 is: 0.33

Volume for 2.5, 5, 2.0 is: 8.33

Explanation:

A function PyramidVolume of type double is created which takes three inputs arguments of type double length, width and height and returns the volume of the pyramid as per the formula given in the question.

Then in the main function we called the PyramidVolume() function with inputs 1.0, 1.0, 1.0 and it returned correct output.

We again tested it with different inputs and again it returned correct output.

hodyreva [135]4 years ago
4 0

Answer / Explanation:

To answer this question, we first define the parameters which are,

Volume: This can be defined or refereed to the quantity of three-dimensional space enclosed by a closed surface. For the purpose of illustration, we can say that the space that a substance or shape occupies or contains. The SI used in measuring volume is mostly in cubic metre.

Therefore,

Volume, where Volume = base area x height x 1/3

where,

Base area = base length x base width

However, we also watch out for the division integer.

So moving forward to write the code solving the question, we have:

double Pyramid Volume (double baseLength, double baseWidth, double pyramid Height)

{

double baseArea = baseLength * baseWidth;

double vol = ((baseArea * pyramidHeight) * 1/3);

return vol;

}

int main() {

  cout << "Volume for 1.0, 1.0, 1.0 is: " << PyramidVolume(1.0, 1.0, 1.0) <<

endl;

  return 0;

}

You might be interested in
3. What is a caliber (relate it to rockets)
Kamila [148]

Answer:

In this context a caliber is defined as the diameter of the body tube, and it is used to support the general rule of thumb that for a rocket of typical aspect ratio to be stable the CG should be one caliber ahead of CP.

Explanation:

6 0
3 years ago
Match each titration term with its definition.
Illusion [34]

Answer:

1) titration

2) titrand

3) equivalence point

4) titrant

5) Burette

6) Indicator

Explanation:

The process in which a known volume of a standard solution is added to another solution so that the standard solution can react with the solution of unknown concentration such that its concentration is determined  can be referred to as titration.

The solution which is added to another solution  is called the titrant.  The titrand is the solution of unknown concentration

A burette is a glassware used to slowly add a known volume of the titrant to the titrand.

The indicator used signals the point when the reaction is complete by a color change. At this point, a stoichiometric amount of titrant has been added to the titrand. This is also referred to as the equivalence point.

3 0
3 years ago
The forming section of a plastics plant puts out a continuous sheet of plastic that is 1.2 m wide and 2 mm thick at a rate of 15
KATRIN_1 [288]

Answer:

attached below

Explanation:

7 0
3 years ago
Which of the following is not a function of the cooling system
Pie

Answer:

hola soy dora

Explanation:

5 0
2 years ago
Define an ADT for a two-dimensional array of integers. Specify precisely the basic operations that can be performed on such arra
VashaNatasha [74]

Answer:

Explanation:

ADT for an 2-D array:

struct array{

int arr[10];

}arrmain[10];

An application that stores an array with 1000 rows and 1000 columns, where less than 10,000 of the array values are non-zero. The two different implementations for such arrays that would be more space efficient than a standard two-dimensional array implementation requiring one million positions are :

1) struct array{

int *p;

}arr[1000];

2) struct array{

int *p;

}arr[1000];

6 0
3 years ago
Other questions:
  • An equilibrium mixture of 3 kmol of CO, 2.5 kmol of O2, and 8 kmol of N2 is heated to 2600 K at a pressure of 5 atm. Determine t
    7·1 answer
  • Benzoic acid 1.35 g, is reacted with oxygen in a constant volumecalorimeter to form H2 O(l) and CO2 (g)at 298 K. the mass of the
    7·1 answer
  • What is 29*69+98-78/36=
    9·2 answers
  • A decorative fountain was built so that water will rise to a hieght of 8 feet above the exit of the pipe. the pipe is 3/4 diamet
    5·1 answer
  • Explain how a CO2 cartridge powers the dragster you will be building. A good website to use is How Stuff Works. (howstuffworks.c
    7·2 answers
  • The goal of the following model is generate a clock waveform that has the clock high 4 time units and low 4 time units, with the
    15·1 answer
  • A civil engineer is analyzing the compressive strength of concrete. The compressive strength is approximately normal distributed
    7·1 answer
  • How many trains have been invented all around the world?
    14·1 answer
  • 4.7 If the maximum tensile force in any of the truss members must be limited to 22 kN, and the maximum compressive force must be
    9·1 answer
  • Name eight safety electrical devices including their functions and effects if not present.​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!