From ca0492fb72059382ba899801cc3aff32ac7a0b7a Mon Sep 17 00:00:00 2001 From: cmitchell2301 Date: Sun, 14 Dec 2025 19:29:35 -0500 Subject: [PATCH] Added documentation and information to the programs --- homework06/git-practice/circle1.py | 18 ++++++++++++++++++ homework06/git-practice/rectangle01.py | 16 ++++++++++++++++ .../git-practice/rectangular-solid01.py | 17 +++++++++++++++++ homework06/git-practice/sphere1.py | 19 +++++++++++++++++++ 4 files changed, 70 insertions(+) create mode 100644 homework06/git-practice/circle1.py create mode 100644 homework06/git-practice/rectangle01.py create mode 100644 homework06/git-practice/rectangular-solid01.py create mode 100644 homework06/git-practice/sphere1.py diff --git a/homework06/git-practice/circle1.py b/homework06/git-practice/circle1.py new file mode 100644 index 0000000..0ab12e5 --- /dev/null +++ b/homework06/git-practice/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/homework06/git-practice/rectangle01.py b/homework06/git-practice/rectangle01.py new file mode 100644 index 0000000..09f3373 --- /dev/null +++ b/homework06/git-practice/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/homework06/git-practice/rectangular-solid01.py b/homework06/git-practice/rectangular-solid01.py new file mode 100644 index 0000000..36a8ddd --- /dev/null +++ b/homework06/git-practice/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/homework06/git-practice/sphere1.py b/homework06/git-practice/sphere1.py new file mode 100644 index 0000000..8b59a6f --- /dev/null +++ b/homework06/git-practice/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}")