subject

This means that the surface area is composed of the base area (i. e., the area of bottom square) plus the side area (i. e., the sum of the areas of all four triangles). You are given the following incomplete code to calculate and print out the total surface area of a square pyramid: linclude > h: base azea- calcBasekrea (a) : cout << "Base auxface area of the squaze pyzamid is" << base area << "square feet."< endi: // add your funetion call to calculate the side ares and assign // the zesult to side area, and then print the result //hdd your function call to print the total surface area return 0F float calcBaseArea (float a) return pou (a, 2) /I add your function definicion for calcSideärea here // add your function definition tor prntSurfârea here This code prompts for, and reads in the side length of the base (a) and height of a square pyramid (h) in feet, and then calculates the surface area. The function prototype (i. e. function declaration), function definition, and function call to calculate and print the base area has already been completed for you. In the above program, a and h are declared in the main function and are local to main. Since a is a local variable, notice how the length a must be passed to calcBaseArea to make this calculation. One of your tasks is to add a new function called calesidearea that computes and returns the side area of the square pyramid. Given that the formula uses both the length a and height h of the square pyramid, you must pass these two local variables to this function. You will assign the returned value of this function to side area and then print the value to the terminal. Refer to what was done for calcBaseArea when adding your code. Your other task is to add a new function called prntsprfArea that accepts the base area and side area values (i. e, these are the parameters) and prints out the total surface area of the square pyramid inside this function. Since this function does not return a value to the calling function, the return type of this function should be void Now, modify the above program, referring to the comments included in the code. Complete the requested changes, and then save the file as Lab7A. opp, making sure it compiles and works as expected. Note that you will submit this file to Canvas

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 13:00
We as humans write math expression in infix notation, e.g. 5 + 2 (the operators are written in-between the operands). in a computer’s language, however, it is preferred to have the operators on the right side of the operands, i.e. 5 2 +. for more complex expressions that include parenthesis and multiple operators, a compiler has to convert the expression into postfix first and then evaluate the resulting postfix.write a program that takes an “infix” expression as input, uses stacks to convert it into postfix expression, and finally evaluates it. it must support the following operations: + - / * ^ % (example infix expression: (7 - 3) / (2 + 2)postfix expression: 7 3 - 2 2 + /result: 1guidelines: 1. you will need to use stacks in three placesa. one for the parenthesis check [char stack]b. one during infix to postfix [char stack]c. one during evaluation [int stack]for a and b above, you can use same array and same push, pop method as both ofthem are char. but for evaluation you have int stack and you might consider to createanother push pop method to handle it. maybe push_int, pop_int, etc. or find otherstrategy to utilize existing push pop method2. you can create a function for obtaining operator priority. that function should take anoperator as input and return its priority as an integer. this function will you a lot andreduce repeated code3. during evaluation you will need to convert char into integer. example for single digit: char c = '5'; int x = c - '0';
Answers: 2
question
Computers and Technology, 22.06.2019 15:50
The file sales data.xlsx contains monthly sales amounts for 40 sales regions. write a sub that uses a for loop to color the interior of every other row (rows 3, 5, etc.) gray. color only the data area, columns a to m. (check the file colors in excel.xlsm to find a nice color of gray.)
Answers: 2
question
Computers and Technology, 22.06.2019 19:20
How might the success of your campaign be affected if you haven’t carefully completed all field data or if you accidentally insert the wrong merge field in the document?
Answers: 2
question
Computers and Technology, 23.06.2019 22:50
An environmental protection agency study of 12 automobiles revealed a correlation of 0.47 between engine size and emissions. at 0.01 significance level, can we conclude that there is a positive association between the variables? what is the p value? interpret.
Answers: 2
You know the right answer?
This means that the surface area is composed of the base area (i. e., the area of bottom square) plu...
Questions
question
Mathematics, 17.04.2021 23:10
question
Mathematics, 17.04.2021 23:10
question
Mathematics, 17.04.2021 23:10
question
Mathematics, 17.04.2021 23:10
question
Mathematics, 17.04.2021 23:10
question
Computers and Technology, 17.04.2021 23:10
Questions on the website: 13722362