From 9841335fae4f92cdacaac8a128dfa3190c44b22f Mon Sep 17 00:00:00 2001 From: jarivera2401 Date: Wed, 14 May 2025 12:20:22 -0400 Subject: [PATCH] Upload files to "/" --- README.txt | 10 ++++++++++ circle1.py | 18 ++++++++++++++++++ rectangle01.py | 16 ++++++++++++++++ rectangular-solid01.py | 17 +++++++++++++++++ sphere1.py | 19 +++++++++++++++++++ 5 files changed, 80 insertions(+) create mode 100644 README.txt create mode 100644 circle1.py create mode 100644 rectangle01.py create mode 100644 rectangular-solid01.py create mode 100644 sphere1.py diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..6652258 --- /dev/null +++ b/README.txt @@ -0,0 +1,10 @@ +This is the "Rectangular Project". As you will see this may have +been a bad choice of naming. + +Step 8 renames a mis-spelled program rectanglar-solid.py to +rectangular-solid.py using the git mv command. Note the name +of the file in the directory and the git repo changes and is +associated. + + +Ed diff --git a/circle1.py b/circle1.py new file mode 100644 index 0000000..0ab12e5 --- /dev/null +++ b/circle1.py @@ -0,0 +1,18 @@ +# Program circle1.py + +startUpMessage = ''' +This program calculates the area of a circle. + +''' + +print(startUpMessage) + +import math +PI = math.pi + +radius = float(input("Enter the radius of a circle ")) + +area = PI * radius**2 + +print(f"The area is {area:.2f}") +print("\n") diff --git a/rectangle01.py b/rectangle01.py new file mode 100644 index 0000000..09f3373 --- /dev/null +++ b/rectangle01.py @@ -0,0 +1,16 @@ +# Program rectangle01.py + +startUpMessage = ''' +This program calculates the area of a rectangle. + +''' + +print(startUpMessage) + +length = float(input("Enter a value for the length ")) +width = float(input("Enter a value for the width ")) + +areaOfRectangle = length * width + +print(f"Area = {areaOfRectangle:.1f}") +print("\n") \ No newline at end of file diff --git a/rectangular-solid01.py b/rectangular-solid01.py new file mode 100644 index 0000000..36a8ddd --- /dev/null +++ b/rectangular-solid01.py @@ -0,0 +1,17 @@ +# Program rectanglar-solid.py + +startUpMessage = ''' +This program calculates the volume of a rectangular solid. + +''' + +print(startUpMessage) + +length = float(input("Enter a value for the length ")) +width = float(input("Enter a value for the width ")) +height = float(input("Enter a value for the height ")) + +volumeOfRectangle = length * width * height + +print(f"Volume = {volumeOfRectangle:.1f}") +print("\n") diff --git a/sphere1.py b/sphere1.py new file mode 100644 index 0000000..8b59a6f --- /dev/null +++ b/sphere1.py @@ -0,0 +1,19 @@ +# Program sphere1.py + +startUpMessage = ''' +This program calculates the volume of a sphere. + +''' + +print(startUpMessage) + + +import math +PI = math.pi + +radius = float(input("Enter the radius of a sphere ")) + + +volume = 4 / 3 * PI * radius**3 + +print(f"The volume of the sphere is {volume:.2f}")