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
-
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...
-
Pace Employment Counsellors provides counselling services to employees of companies that are downsizing. The business had the following account balances: The following transactions occurred during...
-
It is possible to generalize the butterfly position even more to the form with K 1 2 3, and a, b > 0 How are the coefficients a and b to be chosen, to generate a vanishing payoff for S T ? K 1 and S...
-
An undamped vibration absorber removes the original resonance peak but introduces a. one new peak a. two new peaks b. several new peaks
-
Jim Sellers is thinking about producing a new type of electric razor for men. If the market were favorable, he would get a return of $100,000, but if the market for this new type of razor were...
-
Write a MATLAB program that finds the vector acceleration of a body of mass (m). Two forces are acting on this body F1, and F2 as shown in the figure below. Code: F 45 F
-
The Dapper-Dons Partnership was formed ten years ago as a general partnership to custom tailor men's clothing. Dapper-Dons is located at 123 Flamingo Drive in City, ST, 54321. Bob Dapper manages the...
-
The price of a certain share went up by 2% in the first year and by 5% in the second year. In the third year it remained unchanged and in the fourth year it dropped by 1%. Calculate the average...
-
E. Retirement Pay Sue reported the following retirement: First employment for 30 years received at the age of 50 Second employment for 10 years received at the age of 60 Third employment for 10 years...
-
QUESTION 5 [7 marks] Mouna established an RRSP in 2013. As of January 1, 2019, Mouna had no unused deduction room and no undeducted contributions. Her 2018 earned income was sufficient for her to...
-
INDIVIDUALS: TAX BRACKETS Taxable Income Up to $48,535 In excess of $48,535 In excess of $97,069 In excess of $150,473 > $214,368 TAX CREDITS Tax 15% $7,280 plus 20.5% on the next $48,534 $17,230...
-
Consider the table below that sets out data on the Carpe Vinum Company's balance sheet (CV Co). Cash Investment project Total assets 10m ? ? Debt Equity Total liabilities Face Value 50m ? ? The...
-
1. What overall process should be followed to identify key (existing or new) initiatives? 2. How should they be evaluated? 3. What criteria should be used to prioritize them? 4. Who should make these...
-
Timpanogos Inc. is an accrual-method, calendar-year corporation. For 2021, it reported financial statement income after taxes of $1.342.000. Timpanogos provided the following information relating to...
-
The Strahler Stream Order System ranks streams based on the number of tributaries that have merged. It is a top-down system where rivers of the first order are the headwaters (aka outermost...
-
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....
-
If a cylinder of volume \(0.1 \mathrm{~m}^{3}\) is filled with \(1.373 \mathrm{~kg}\) of ammonia at \(1.95 \mathrm{MPa}\), determine the temperature at which ammonia exists in the cylinder. Assume...
-
Nitrogen at 15 bar is used to fill a container of \(0.25 \mathrm{~m}^{3}\). The filling process is very slow and the contents of the tank attain the room temperature of \(295 \mathrm{~K}\). How much...
-
A tank of \(1 \mathrm{~m}^{3}\) volume is filled with \(5 \mathrm{~kg}\) ammonia at \(300 \mathrm{~K}\). Determine the pressure exerted by ammonia using the Redlich-Kwong equation.
Study smarter with the SolutionInn App