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.

EBK JAVA PROGRAMMING
8th Edition
ISBN:9781305480537
Author:FARRELL
Publisher:FARRELL
Chapter16: Graphics
Section: Chapter Questions
Problem 14RQ
icon
Related questions
Question

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.

 
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT