2024-12-21 20:54:42 -05:00
|
|
|
# Program rectangle01.py
|
|
|
|
|
|
|
|
startUpMessage = '''
|
|
|
|
This program calculates the area of a rectangle.
|
|
|
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
print(startUpMessage)
|
2024-12-21 20:36:23 -05:00
|
|
|
|
2024-12-21 20:49:35 -05:00
|
|
|
length = float(input("Enter a value for the length "))
|
|
|
|
width = float(input("Enter a value for the width "))
|
2024-12-21 20:36:23 -05:00
|
|
|
|
|
|
|
areaOfRectangle = length * width
|
|
|
|
|
2024-12-21 20:54:42 -05:00
|
|
|
print(f"Area = {areaOfRectangle:.1f}")
|
|
|
|
print("\n")
|