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 14:00
What are procedures that keep a data base current
Answers: 1
question
Computers and Technology, 23.06.2019 08:30
Based on your knowledge of a good network, describe what you think is a perfect network would be. what kind of information and resources could users share on this network. what would the network administrator do? what kind of communication would be used?
Answers: 1
question
Computers and Technology, 23.06.2019 13:00
Donnie does not have powerpoint. which method would be best for elana to save and share her presentation as is? a pdf a doc an rtf a ppt
Answers: 3
question
Computers and Technology, 23.06.2019 15:20
In a game with three frames, where will the objects on layer 1 appear? a. next to the play area b. in the middle of the game c. behind everything else d. in front of everything else
Answers: 1
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, 15.01.2021 18:50
question
Mathematics, 15.01.2021 18:50
question
Mathematics, 15.01.2021 18:50
Questions on the website: 13722363