In this problem you will calculate the area of a house and compare it with another house to see which one is bigger. House1 vs. House2 We need to have a struct that has width and length in it. This struct represents a rectangular room. From room we need to define: Bathroom, Livingroom, Bedroom and Kitchen. An example of the struct and Bathroom, Livingroom, Bedroom and Kitchen is shown below. Also, it is shown how to set value of Bathroom Length and Width- values are assumed in feet. House area is in Square Feet (sqrft) and can be calculated by adding all room areas together in sqrft. Program example: Struct room { Length; Width: }; Struct room Bathroom1 , Livingroom1, Kitchen1, Bedroom1; Bathroom1.Length=10; Bathroom1.Width=7; Now Given: House1 is comprised of: Bedroom1 (L=15,W=10) Bathroom1 (L=10,W=7) Kitchen1(L=15, W= 10) Livingroom1 (L=25,W=20) House2 is comprised of: Bedroom2_1 (L=10, W=10) Bedroom2_2(L=10, W=12) Kitchen2(L=16,W=10) Livingroom2 (L=15,W=12) Calculate each House area and determine which is the larger House and report it promptly.
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
In this problem you will calculate the area of a house and compare it with another house to see
which one is bigger. House1 vs. House2
We need to have a struct that has width and length in it. This struct represents a rectangular
room. From room we need to define:
Bathroom, Livingroom, Bedroom and Kitchen.
An example of the struct and Bathroom, Livingroom, Bedroom and Kitchen is shown below.
Also, it is shown how to set value of Bathroom Length and Width- values are assumed in feet.
House area is in Square Feet (sqrft) and can be calculated by adding all room areas together in
sqrft.
Program example:
Struct room {
Length;
Width:
};
Struct room Bathroom1
, Livingroom1,
Kitchen1, Bedroom1;
Bathroom1.Length=10;
Bathroom1.Width=7;
Now Given:
House1 is comprised of:
Bedroom1 (L=15,W=10)
Bathroom1 (L=10,W=7)
Kitchen1(L=15, W= 10)
Livingroom1 (L=25,W=20)
House2 is comprised of:
Bedroom2_1 (L=10, W=10)
Bedroom2_2(L=10, W=12)
Kitchen2(L=16,W=10)
Livingroom2 (L=15,W=12)
Calculate each House area and determine which is the larger House and report it promptly.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images