From 195a455032f001112cc3f41f1a37cfda4d6e2827 Mon Sep 17 00:00:00 2001 From: cmitchell2301 Date: Sun, 14 Dec 2025 19:14:27 -0500 Subject: [PATCH] Added circle and sphere calculations --- homework06/git-practice/circle1.py | 9 +++++++++ homework06/git-practice/rectanglar-solid01.py | 8 -------- homework06/git-practice/rectangle01.py | 7 ------- homework06/git-practice/sphere1.py | 10 ++++++++++ 4 files changed, 19 insertions(+), 15 deletions(-) create mode 100644 homework06/git-practice/circle1.py delete mode 100644 homework06/git-practice/rectanglar-solid01.py delete mode 100644 homework06/git-practice/rectangle01.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..0533a90 --- /dev/null +++ b/homework06/git-practice/circle1.py @@ -0,0 +1,9 @@ +import math +PI = math.pi + +radius = float(input("Enter the radius of a circle ")) + +area = PI * radius**2 + +print(f"The area is {area}") + diff --git a/homework06/git-practice/rectanglar-solid01.py b/homework06/git-practice/rectanglar-solid01.py deleted file mode 100644 index 3a4779e..0000000 --- a/homework06/git-practice/rectanglar-solid01.py +++ /dev/null @@ -1,8 +0,0 @@ - -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}") \ No newline at end of file diff --git a/homework06/git-practice/rectangle01.py b/homework06/git-practice/rectangle01.py deleted file mode 100644 index 2b1b70e..0000000 --- a/homework06/git-practice/rectangle01.py +++ /dev/null @@ -1,7 +0,0 @@ - -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}") \ No newline at end of file diff --git a/homework06/git-practice/sphere1.py b/homework06/git-practice/sphere1.py new file mode 100644 index 0000000..4b110e9 --- /dev/null +++ b/homework06/git-practice/sphere1.py @@ -0,0 +1,10 @@ + +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}")