answer.
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
AlekseyPX
2 years ago
7

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/3 Base area = base length x base width. (Watch out for integer division).

Computers and Technology
2 answers:
posledela2 years ago
8 0

Answer:

The Program to this question can be given as:

Program:

#include <iostream> //header file.

using namespace std;

double PyramidVolume(double baseLength, double baseWidth, double pyramidHeight)  //define a method PyramidVolume

{

   double baseArea,Volume; //declare variable.

   baseArea= baseLength * baseWidth;  //calculate baseArea

   Volume = ((baseArea * pyramidHeight) * 1/3);  //calculate Volume

   return Volume; //return Volume

}

int main() //define main method.

{

double x,baseLength,baseWidth,pyramidHeight; //define variable.

cout<<"Enter baseLength :"; //message.

cin>>baseLength; //input value.

cout<<"Enter baseWidth :";//message.

cin>>baseWidth;  //input value.

cout<<"Enter pyramidHeight :";//message.

cin>>pyramidHeight;  //input value.

x=PyramidVolume(baseLength,baseWidth,pyramidHeight); //calling

cout << "Volume of given value is :"<<x; //print value.

return 0;

}

Output:

Enter baseLength :1.0

Enter baseWidth :1.0

Enter pyramidHeight :1.0

Volume of given value is :0.333333

Explanation:

The description of the above program can be given as:

  • In the above c++ language program firstly we include the header file. Then we define a function that is " PyramidVolume". The return type of this function is double because it return value and in this function, we pass three-parameter that is baseLength, baseWidth, and pyramidHeight. The data type of this variable is double.
  • In this function, we define two variable that is "baseArea and Volume" that is used for holding the calculated value. The variable baseArea holds the area of the pyramid and the volume variable holds the volume of the pyramid.
  • Then we define a main function. In this function, we define four variables that is "x, baseLength, baseWidth, and pyramidHeight". The baseLength, baseWidth, and pyramidHeight variable are used to take input from the user and pass into the function. The variable x is used to hold the return value of the function and we print this variable.

zubka84 [21]2 years ago
3 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
. Write a function wordscramble that will receive a word in a string as an input argument. It will then randomly scramble the le
inysia [295]

Answer: You can use the function randperm() to generate a random permutation of the indexes. so then you would use the random permutation to reorder the string array

Explanation:

4 0
1 year ago
____ is a program placed on a computer without the user's knowledge that secretly collects information about the user
Scrat [10]
<span>Spyware is a program placed on a computer without the user's knowledge that secretly collects information about the user.
</span><span>The spyware gathers information and can send this information to another program or entity which can take control over the device or use personal information to harm the user. </span>
7 0
2 years ago
Select the correct navigational path to freeze the top row of your worksheet. Select the panes you wish to freeze. Click the tab
Artemon [7]

Yeah, Your steps ar correct. Let's analyse those steps more easily by the following steps:

\Large{ \boxed{ \bf{ \color{aqua}{Freeze \: panes:}}}}

Freeze panes is a feature in spreadsheet applications, such as Microsoft Excel, LibreOffice Calc, and Google Sheets. It "freezes" a row or column, so that it is always displayed, even as you navigate the spreadsheet.

❍ Freezing panes is especially useful if your spreadsheet has a header row, that you want to always be visible.

  • Select the row below the row(s) you want to freeze. In our example, we want to freeze rows 1 and 2, so we'll select row.
  • Click the View tab on the Ribbon.
  • Select the Freeze Panes command, then choose Freeze
  • Panes from the drop-down menu. ...
  • The rows will be frozen in place, as indicated by the gray line.

<u>━━━━━━━━━━━━━━━━━━━━</u>

6 0
1 year ago
Read 2 more answers
Why is it important to back up data on a computer before you burn-in test the cpu?
katen-ka-za [31]
A burn-in test is a test which is usually performed on a system or component by running it for a long time in order to bring out any errors or system failures etc. 
While doing it on CPU the data must be backed up as any kind of error or failure may result in the loss of data, at time systems can be repaired to retrieve data but still there is no guarantee, backing up is the best option.
5 0
1 year ago
Jefferson is interested in starting his own business. He plans to borrow money from the local bank in order to finance the busin
sweet [91]
A business plan and a <u>financial plan</u> to show the both his plan to make money, and how much money he will make, spend, use.
8 0
2 years ago
Read 2 more answers
Other questions:
  • A business wants to centralize its administrative tasks. At the same time, it wants the existing systems to manage and sustain t
    14·2 answers
  • The ______ is the information center that drivers need to refer to when they're NOT scanning the road.
    7·1 answer
  • A U.S. social security number consists of a string of 9 digits, such as "444422333". Assume that input consists of a sequence of
    6·2 answers
  • Mara's presentation included essential information about the company's new safety procedures. She wanted to make
    13·2 answers
  • A company wants to publish Knowledge articles to its Customer Community. The articles should be organized for easy navigation by
    6·1 answer
  • What output is produced by the following program segment? Why? (Recall that name.charAt(i) is the i-th character in the string,
    11·1 answer
  • Show the stack with all activation record instances, including static and dynamic chains, when execution reaches position 1 in t
    10·1 answer
  • Amanda a recently moved into a new home. Everyone has their own tablet, and wants to connect to the same network, no matter wher
    12·1 answer
  • Which of these tools can best be used as a self assessment for career planning purposes? a personality test an asset analysis a
    5·1 answer
  • Which are types of lines? Choose three answers.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!