Write a C++ program that inputs the length and width of two rectangles (in integers) representing...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a C++ program that inputs the length and width of two rectangles (in integers) representing a house and a garage. Write a function that uses Call-by- Value int rectArea (int len, int wid) that returns the area of a rectangle with length len and width wid. Divide the area of the garage by the area of the house and multiply by 100 to determine the percentage (int). Enter your name as a Global variable and all other variables should be local variables in main or rectArea. Area = length*width Percentage = 100* GarageArea/HouseArea Sample Input Length of House (ft): 50 Width of House (ft): 60 Length of Garage (ft): 10 Width of Garage (ft):20 Write a C++ program that inputs the length and width of two rectangles (in integers) representing a house and a garage. Write a function that uses Call-by- Value int rectArea (int len, int wid) that returns the area of a rectangle with length len and width wid. Divide the area of the garage by the area of the house and multiply by 100 to determine the percentage (int). Enter your name as a Global variable and all other variables should be local variables in main or rectArea. Area = length*width Percentage = 100* GarageArea/HouseArea Sample Input Length of House (ft): 50 Width of House (ft): 60 Length of Garage (ft): 10 Width of Garage (ft):20
Expert Answer:
Answer rating: 100% (QA)
The assignment requires writing a C program that consists of a function rectArea to calculate the ar... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Problem 13-7 (Algo) Prepare a Statement of Cash Flows [LO13-1, LO13-2] [The following information applies to the questions displayed below.] Comparative financial statements for Weaver Company...
-
Please do the following Matlab problem, 1.Write a for loop ranging from 3 to 5. In the loop, print the value of the loop index to the screen using fprintf in the following format: Value is n where n...
-
The area of a rectangle is the rectangle's length times it's width. Write a program that asks for the length and width of two rectangles. The program should tell the user which rectangle has the...
-
Welch Company prepares monthly financial statements. Below are listed some selected accounts and their balances in the September 30 trial balance before any adjustments have been made for the month...
-
An ideal air-conditioning system uses R134a as the refrigerant. The compressor has an inlet pressure of 20 psia and an exit pressure of 260 psia with a mass flow rate of 0.6 lbm/s. Refer to Fig....
-
Describe the basic process of user interface design.
-
\((-8,919) \times(-3,401)\) Complete the indicated calculation.
-
Bell Company, a manufacturer of audio systems, started its production in October 2012. For the preceding 3 years, Bell had been a retailer of audio systems. After a thorough survey of audio system...
-
xam 1 Consider the following two projects: Cash flows Project A Project B Co -$180 -$180 C1 70 88 C2 70 88 C3 70 88 CA 70 a. If the opportunity cost of capital is 10%, which of these two projects...
-
At which point in the diagram is the magnetic field strength (a) The smallest and (b) The largest? Explain. D E. B. F.
-
(13) Mr. Faizal, who just graduated in accounting, is auditing the company's financial statements for the year ended 31 December 2020. He noticed that on 1 January 2020, the company entered into a...
-
Watch the following video, and practice completing a Running Narrative for display within a classroom setting. May I Take Your Order video In this clip Emily (braided blonde hair) reveals what she...
-
Required Information [The following Information applies to the questions displayed below.] Wapato Corporation purchased a new plece of equipment at the beginning of Year 1 for $1,000,000. The...
-
Ethnocentrism is the tendency of people toput their own culture at the center, and to use their culturalstandards to judge the behavior and beliefs of people of differentcultures. People who are...
-
Two large water reservoirs are connected by 610 m of 3-in. schedule 40 pipe. Water at 20C is to be bumbed from one to the other at a rate of 200 gallon ber minute. Both tanks are open to the...
-
The wall of an industrial furnace is constructed from 0.3 m thick fireclay brick having a thermal conductivity of 1.2 W/m/K. Measurements made during steady-state operation reveal temperatures of...
-
When a random sample is not representative of the population as a whole, we refer to it as sampling error. What can you do to reduce your risk of sampling error? In other words, what can you change...
-
CdF2 (s) Cd+ (aq) + 2 F- (aq) 1. A saturated solution of CdF2 is prepared. The equilibrium in the solution is represented above. In the solution [Cd+] eq = 0.0585 M and [F-] eq = 0.117 M. a....
-
Decide whether the statement is true or false. Justify your answer. 1. If y is directly proportional to x and x is directly proportional to z, then y is directly proportional to z. 2. If y is...
-
Identify the x- and y-intercepts of the graph. 1. y = (x - 3)2 2. y = 16 - 4x2 3. y = |x + 2| 4. y2 = 4 - x 5. y = 2 - 2x3 6. y = x3 - 4x y 10 6. 4 2 to -4 -2 2 4 6 8 y 20 8. 4 1 3
-
An airplane, flying at an altitude of 6 miles, is on a flight path that passes directly over an observer (see figure). Let θ be the angle of elevation from the observer to the plane....
-
What approach(es) are used to analyze impairment on available-for-sale and held-to-maturity debt securities?
-
On January 1,2020 , Sharp Company purchased \(\$ 50,000\) of Sox Company \(6 \%\) bonds, at a time when the market rate was \(5 \%\). The bonds mature on December 31, 2024, and pay interest annually...
-
Referring to information in Brief Exercise 14-18, assume that Henry Inc. sold its holdings of Container Corporation bonds on July 2, 2020, for \(\$ 4,800\). a. Record the sale of the debt investment....
Study smarter with the SolutionInn App