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
Realize the function f(a, b, c, d, e) = Σ m(6, 7, 9, 11, 12, 13, 16, 17, 18, 20, 21, 23, 25, 28)using a 16-to-1 MUX with control
NNADVOKAT [17]

Answer:

See explaination

Explanation:

please see attachment for the detailed diagram used in solving the given problem.

It is attached as an attachment.

7 0
3 years ago
Diana and Kinsey are put in charge of choosing a mascot for their basketball team. There are fifteen players on the team, but Di
arsen [322]

Answer:

the data are inadequate

Explanation:

<u>If there are 15 people on the team, and only five have been asked about the mascot, </u><u>this means the data collecting is wrong, and the result doesn’t include thoughts of the majority</u>. If Diana and Kinsey want to have adequate data,<u> they should ask as many as possible, if not all players in the team</u>. This would truly show what the majority wants meaning it will show what the team wants. This kind of complete data correcting is the correct one.

6 0
3 years ago
Which of the following best characterizes a scientific law?
sesenic [268]

Answer:

subjective im pretty sure

Explanation:

6 0
3 years ago
the hoop is cast on the rough surface such that it has an angular velocity w=4rad/s and an angular acceleration a=5rad/s^2. also
IgorLugansk [536]

Given Information:

Angular velocity = ω = 4 rad/s

Angular acceleration = α = 5 rad/s²

Center deceleration = a₀ = 2 m/s

Required Information:

Acceleration of point A at this instant = ?

Answer:

Acceleration of point A at this instant = 5.94 m/s²

Explanation:

Refer to the attached diagram of the question,

The acceleration of point A is given by

a = a₀ + rα - rω²

Where r is the radial distance between the center and point A, a₀ is the deceleration of center, α is the angular acceleration and ω is the angular velocity.

a = -2i + 0.3j*5k - 0.3j*4²

a = -2i + 1.5(j*k) - 0.3j*16

a = -2i + 1.5(-i) - 4.8j

a = -2i - 1.5i - 4.8j

a = -3.5i - 4.8j

The magnitude of acceleration vector is

a = √(-3.5)² + (-4.8)²

a = √35.29

a = 5.94 m/s²

Therefore, the acceleration of point A is 5.94 m/s²

The angle is given by

θ = tan⁻¹(y/x)

θ = tan⁻¹(-4.8/-3.5)

θ = 53.9°

7 0
4 years ago
O que é necessário se conhecer para a determinação de uma força concentrada em um ponto?
skelet666 [1.2K]

Answer: its c

Explanation:

7 0
3 years ago
Other questions:
  • What are primary and secondary super-heaters?
    9·1 answer
  • Write an ALP to separate odd and even numbers from an array of N numbers; arrange odd
    13·1 answer
  • If a barrel of oil weighs 1.5 kN, calculate the specific weight, density, and specific gravity of the oil. The barrel weighs 110
    7·1 answer
  • A distillation column with a partial reboiler and a total condenser is being used to separate a mixture of benzene, toluene, and
    6·1 answer
  • Given: A graphite-moderated nuclear reactor. Heat is generated uniformly in uranium rods of 0.05m diameter at the rate of 7.5 x
    15·1 answer
  • A planes leaves Arcra ab 10:40pm and arrives in Germany at 07:32 the
    8·1 answer
  • IMPORTANT PLEASE HELP!
    6·2 answers
  • Which option identifies the most likely scaling factor in the above drawing of the Mercury capsule and booster unit? 1:1,000 1:1
    14·1 answer
  • Scrooge McNugget wants to store information (names, addresses, descriptions of embarrassing moments, etc.) about the many ducks
    6·1 answer
  • What is valve overlap?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!