7Area of a Rectangular Room

When working in a global environment, you’ll have to present information in both metric and Imperial units. And you’ll need to know when to do the conversion to ensure the most accurate results.

Create a program that calculates the area of a room. Prompt the user for the length and width of the room in feet. Then display the area in both square feet and square meters.

Example Output

 
What is the length of the room in feet? 15
 
What is the width of the room in feet? 20
 
You entered dimensions of 15 feet by 20 feet.
 
The area is
 
300 square feet
 
27.871 square meters

The formula for this conversion is

images/_pragprog/svg-0001.png

Constraints

  • Keep the ...

Get Exercises for Programmers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.