1 Surface Area = Base Height + Base Width The total surface area is the sum...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1 Surface Area = Base Height + Base Width The total surface area is the sum of the triangular area and rectangular area. Complete the following code to compute the total surface area of the shape. You should name this project as Lab6A. * This program prompts for and reads in the value of height, base, and width in feet. This program uses two functions: Train_area and Rect_area to calculate the area of the triangle and the area of the rectangle, respectively. The following parameters: height, base, and width have been declared as floating-point number on the main function. * The function declaration (prototype), function definition, and function call for Trian area have been shown on the code. The parameters: base, and height have been passed to Trian_area function to calculate the area of the triangular area. The value returned by Trian_area function has been assigned to a variable named areal. Task 1: Now, you need to work on the function named Rect area which calculates the rectangular area of shape. You need to write function declaration (prototype), function definition, and function call for Rect area function. You need to pass local variable base and width to the Rect area function. The Rect_area function returns the area of the rectangle to the main. You will assign the value returned by this function to area2. • Task 2: Now, add rectangle area and triangle area on the main to calculate the total surface area of the shape. Now, print total surface area of the shape on the terminal according to sample output. #include <iostream> using namespace std; float Trian_area(float base, float height); // Function declaration for Train area 1/ Write function declaration for Rect_area int main() // Variable declaration float base, height, width, areal, area2, total_area; coutc<"Enter the value of base, height and width in feet: "; cin>>base>>height>>width; // Function call to compute triangle area areal- Trian_area(base, height); //Function call to compute rectangle area // write code here // Add areal and area2 to compute total surface area and print total surface area // write code here // Function definition for Train area float Trian_area(float base, float height) return 0.5 base height; //Function definition for Rect area // write code here Sample output 1: Enter the value of base, height and width in feet: 10 30 20 Total surface area of the shape: 350 square feet 1 Surface Area = Base Height + Base Width The total surface area is the sum of the triangular area and rectangular area. Complete the following code to compute the total surface area of the shape. You should name this project as Lab6A. * This program prompts for and reads in the value of height, base, and width in feet. This program uses two functions: Train_area and Rect_area to calculate the area of the triangle and the area of the rectangle, respectively. The following parameters: height, base, and width have been declared as floating-point number on the main function. * The function declaration (prototype), function definition, and function call for Trian area have been shown on the code. The parameters: base, and height have been passed to Trian_area function to calculate the area of the triangular area. The value returned by Trian_area function has been assigned to a variable named areal. Task 1: Now, you need to work on the function named Rect area which calculates the rectangular area of shape. You need to write function declaration (prototype), function definition, and function call for Rect area function. You need to pass local variable base and width to the Rect area function. The Rect_area function returns the area of the rectangle to the main. You will assign the value returned by this function to area2. • Task 2: Now, add rectangle area and triangle area on the main to calculate the total surface area of the shape. Now, print total surface area of the shape on the terminal according to sample output. #include <iostream> using namespace std; float Trian_area(float base, float height); // Function declaration for Train area 1/ Write function declaration for Rect_area int main() // Variable declaration float base, height, width, areal, area2, total_area; coutc<"Enter the value of base, height and width in feet: "; cin>>base>>height>>width; // Function call to compute triangle area areal- Trian_area(base, height); //Function call to compute rectangle area // write code here // Add areal and area2 to compute total surface area and print total surface area // write code here // Function definition for Train area float Trian_area(float base, float height) return 0.5 base height; //Function definition for Rect area // write code here Sample output 1: Enter the value of base, height and width in feet: 10 30 20 Total surface area of the shape: 350 square feet
Expert Answer:
Answer rating: 100% (QA)
Source code of the program is given belowDetailed comments are included for bette... View the full answer
Posted Date:
Students also viewed these accounting questions
-
you created a program named Triangle in which you displayed a seven-line triangle pattern like the one in Figure 6-33 by using a series of println() statements. Now, using your knowledge of loops,...
-
You have been assigned to work on your firms largest client, DOMO Electronics, a publicly traded company with operations in North and South America, Europe, and Asia. In your process of evaluating...
-
Surface defects have been counted on 25 rectangular steel plates, and the data are shown in Table 6E.9. Set up a control chart for nonconformities using these data. Does the process producing the...
-
Fill in each blank so that the resulting statement is true. I find (f g)(x) by replacing each occurrence of x in the equation for_______ with________ .
-
The cigarette industry is subject to litigation for health hazards posed by its products. The industry has been in an ongoing process of negotiating a settlement of these claims with state and...
-
Use the Table of Integrals on the Reference Pages to evaluate the integral.
-
Which of the following is not a reason an internal auditor should participate in internal control reviews during the design of new systems? a. It is more economical to design controls during the...
-
On December 31, the following data were accumulated for preparing the adjusting entries for Bellingham Realty: The supplies account balance on December 31 is $1,375. The supplies on hand on December...
-
A new furnace for your small factory will cost $31,000 and a year to install, will require ongoing maintenance expenditures of $4,600 a year. But it is far more fuel-efficient than your old furnace...
-
It's currently January 1, 2023, and you'll be going on Shark Tank in 2 weeks. Using the information below, create your 5 year Sales, Cost of Goods Sold (COGS), and Gross Profit forecast for the years...
-
an executive summary of the case background and issues involved. what are the main financial decisions involved? data and analysis as a financial manager would present before the board. this should...
-
Which manager is the best person to conduct the exit interview? Explain.
-
Which of the widely accepted standards should Program Managers refer to when planning for climate adaptation?
-
Part 1 Mission Redefine Lee's mission. Lee's current mission is more of a product-oriented mission statement. For example, "We sell flowers" or "We make pizza." Write a marketing-oriented mission...
-
Orca Industries Below are the two most recent balance sheets and most recent income statement for Orca Industries. The company has an effective tax rate of 3 0 % . Balance Sheet Year 1 Year 0 Assets:...
-
Which organization provides resources for professionals that are involved in editing medical records produced by speech recognition software?
-
Q: 1) Section: A There are 4 questions. Answer any three (Total marks: 3X15=45) (15 Marks) In terms of information availability (Exploratory, Descriptive or Causal) what type of research techniques...
-
Horse serum containing specific antibody to snake venom has been a successful approach to treating snakebite in humans. How do you think this anti-venom could be generated? What are some advantages...
-
A pipeline containing \(99.0 \mathrm{~mol} \%\) ammonia and \(1.0 \mathrm{~mol} \%\) hydrogen gas is vented to ambient air via a \(15 \mathrm{~m}\) long, \(3.5 \mathrm{~mm}\) diameter tube....
-
For accounting purposes, how are liabilities defined?
-
What does the term current liabilities mean?
Study smarter with the SolutionInn App