Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

0.00 K/s E (O 81% 1:49 A function\'s statements may include function calls, know

ID: 3598263 • Letter: 0

Question

0.00 K/s E (O 81% 1:49 A function's statements may include function calls, known as hierarchical function calls or nested function calls. Note that main0 itself i function, being the first function called when a program begins executing. and note that main) calls other functions in the earlier exampl Exploring further . Function definition from msdn.microsoft.com . Function call from msdn microsoft.com 7.3 2: Function call in expression. Assign to maxSum the max of (numA, numB) PLUS the max of (numY, numz). Use just one statement. Hint Call FindMax0 twice in an expression. 1 dinclude 3 double Findwa double null, double num2) { 6 Note: if-else staterents need not be understood to complete this activity couble naxal 0.0: 7f (nun nun2)if nu is greater than nunz, natial = numi;. // then num is the naxVal 10 else Ctherwise num2 is the naxval naxal nun2: 13 return maxval; 6int naincvoid) R 17 couble nuriA.0 couble nu 10.0 19 Couble nuniy 3.0 20 couble nun 7.0; 21 couble max5un 0.0 Run View your last submission Feedback? CHALLENGE 733 Function definition: Volume of a pyramid Define a function PyramidVolume with double parameters baselength, baseWidth, and pyramidHeight, that returns as a double the volume 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). 1 tinclude

Explanation / Answer

1)

      This is a very simple problem , Here maxSum is declared as 0.0 then we need maxSum as the sum of max of the numA and numB , max of numY and numZ

So we can simply call the function FindMax twice ie

    maxSum = FindMax(numA, numB) + FindMax(numY , numZ); // simply paste this in your program

   so here maxSum will contain the sum of (max of numA and numB , and max of numY and numZ)

2)

      We need a function defenition that find the volume of a pyramid

Here is the function code copy and paste it

double PyramidVolume(double baseLenth,double baseWidth,double pyramidHeight)
{
   double baseArea,volume;
   baseArea = baseLenth*baseWidth; // find baseArea
   volume = baseArea * pyramidHeight / 3; // you can use () for division but here it is not necessary
  
   return volume;
}

don't necessary to calculate base area can be done in one step