Friday, February 1, 2019

Area of a Room

  • Problem Description

    Write a program that asks the user to enter the width and length of a room. 

    Once the values have been read, your program should compute and display the area of the room. 

    The length and the width will be entered as floating point numbers. Include units in your prompt and output message; either feet or meters, depending on which unit you are more comfortable working with.

    Formula = length*width
  • CODING ARENA
  • a=float(input())
    b=float(input())
    c=a*b
    print("The area of the room is",round(c,2),"square feet")
  • Test Case 1

    Input (stdin)
    23.44
    
    22.33
    
    
    Expected Output
    The area of the room is 523.42 square feet
  • Test Case 2

    Input (stdin)
    18.66
    
    22.45
    
    
    Expected Output
    The area of the room is 418.92 square feet

No comments:

Post a Comment