#!/usr/bin/python3
import sys

# Program: rectangle-volume.py
# Objective: Calculate the volume of a rectanglar solid. 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)

try:
    height = input("Enter a value for height ")
    height = float(height)
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 * height

print(f"The volume of the rectanglar solid is {area:.1f}")
