#!/usr/bin/python3
import sys

# Program: rectangle-area05.py
# Objective: Calculate the area of a rectangle. Check for numeric error on length.
# Revisions
#           Specify the type of the error as ValueError and print the error type.
#           Added same to width.
# Edward Bigos

try:
    length = float(input("Enter a value for length "))
except ValueError as error:
    print("Error: ",error)
    print("You have entered an invalid value. The input must be a number.")
    sys.exit(-1)

try:
    width = input("Enter a value for width ")
    width = float(width)
except ValueError as error:
    print("Error: ",error)
    print("You have entered an invalid value. The input must be a number.")
    sys.exit(-1)

area = length * width

print(f"The area of the rectangle is {area:.1f}")
