Started Rectangle Project

This commit is contained in:
cmitchell2301 2025-12-14 18:34:36 -05:00
commit 26e1253c0d
39 changed files with 544 additions and 0 deletions

BIN
homework06/program-files/.DS_Store vendored Normal file

Binary file not shown.

View file

@ -0,0 +1,7 @@
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.
Ed

View file

@ -0,0 +1,7 @@
length = 4
width = 3
areaOfRectangle = length * width
print("Area = ",areaOfRectangle)

View file

@ -0,0 +1,7 @@
length = float(input("Enter a value for length "))
width = float(input("Enter a value for width "))
areaOfRectangle = length * width
print("Area = ",areaOfRectangle)

View file

@ -0,0 +1,7 @@
length = float(input("Enter a value for length "))
width = float(input("Enter a value for width "))
areaOfRectangle = length * width
print(f"Area = {areaOfRectangle:.2f}")

View file

@ -0,0 +1,8 @@
length = float(input("Enter a value for length "))
width = float(input("Enter a value for width "))
height = float(input("Enter a value for height "))
volumeOfRectangle = length * width * height
print(f"Area = {volumeOfRectangle:.2f}")

View file

@ -0,0 +1,8 @@
length = float(input("Enter a value for length "))
width = float(input("Enter a value for width "))
height = float(input("Enter a value for height "))
volumeOfRectangle = length * width * height
print(f"Area = {volumeOfRectangle:.1f}")

View file

@ -0,0 +1,7 @@
length = float(input("Enter a value for length "))
width = float(input("Enter a value for width "))
areaOfRectangle = length * width
print(f"Area = {areaOfRectangle:.1f}")

View file

@ -0,0 +1,8 @@
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}")

View file

@ -0,0 +1,7 @@
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}")

View file

@ -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}")

View file

@ -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}")

Binary file not shown.

View file

@ -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

View file

@ -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")

View file

@ -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")

View file

@ -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")

View file

@ -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}")