From 8b1c9656c67549bbd37b0306017fc8d6ee278fd5 Mon Sep 17 00:00:00 2001 From: Edward Bigos Date: Tue, 23 Sep 2025 10:36:43 -0400 Subject: [PATCH] Added Lecture code 2025 0923 --- .gitignore | 7 +++--- bigos/lecture20250923/circleArea01.py | 16 ++++++++++++++ bigos/lecture20250923/circleArea02.py | 19 ++++++++++++++++ bigos/lecture20250923/reactangleArea03.py | 16 ++++++++++++++ bigos/lecture20250923/rectangleArea01.py | 13 +++++++++++ bigos/lecture20250923/rectangleArea02.py | 16 ++++++++++++++ bigos/lecture20250923/rectanglePerimeter01.py | 22 +++++++++++++++++++ bigos/lecture20250923/sphereVolume01.py | 15 +++++++++++++ 8 files changed, 120 insertions(+), 4 deletions(-) create mode 100644 bigos/lecture20250923/circleArea01.py create mode 100644 bigos/lecture20250923/circleArea02.py create mode 100644 bigos/lecture20250923/reactangleArea03.py create mode 100644 bigos/lecture20250923/rectangleArea01.py create mode 100644 bigos/lecture20250923/rectangleArea02.py create mode 100644 bigos/lecture20250923/rectanglePerimeter01.py create mode 100644 bigos/lecture20250923/sphereVolume01.py diff --git a/.gitignore b/.gitignore index ab3e8ce..615d682 100644 --- a/.gitignore +++ b/.gitignore @@ -107,10 +107,8 @@ ipython_config.py #pdm.lock # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it # in version control. -# https://pdm.fming.dev/latest/usage/project/#working-with-version-control +# https://pdm.fming.dev/#use-with-ide .pdm.toml -.pdm-python -.pdm-build/ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm __pypackages__/ @@ -160,5 +158,6 @@ cython_debug/ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. -#.idea/ +.idea/ +.DS_Store diff --git a/bigos/lecture20250923/circleArea01.py b/bigos/lecture20250923/circleArea01.py new file mode 100644 index 0000000..9f7fe62 --- /dev/null +++ b/bigos/lecture20250923/circleArea01.py @@ -0,0 +1,16 @@ +# Program: circleArea01 +# Objective: Calculate the area of a circle using floats. +# Author: Edward Bigos +# Date: 2025-0923 + +print("\nCalculate the area of a circle\n") + +PI = 3.1415 + +radius = float(input("Enter a value for radius: ")) + +area = PI * radius * radius + +print("\n") + +print(f"The area of circle of radius {radius} is {area}") diff --git a/bigos/lecture20250923/circleArea02.py b/bigos/lecture20250923/circleArea02.py new file mode 100644 index 0000000..f6faf6c --- /dev/null +++ b/bigos/lecture20250923/circleArea02.py @@ -0,0 +1,19 @@ +# Program: circleArea01 +# Objective: Calculate the area of a circle using floats. +# Author: Edward Bigos +# Date: 2025-0923 + +import math + +print("\nCalculate the area of a circle\n") + +PI = math.pi +print(f"PI is {PI}") + +radius = float(input("Enter a value for radius: ")) + +area = PI * radius * radius + +print("\n") + +print(f"The area of circle of radius {radius} is {area}") diff --git a/bigos/lecture20250923/reactangleArea03.py b/bigos/lecture20250923/reactangleArea03.py new file mode 100644 index 0000000..5e018f3 --- /dev/null +++ b/bigos/lecture20250923/reactangleArea03.py @@ -0,0 +1,16 @@ + +# Program: rectangleArea03 +# Objective: Calculate the area of a rectangle using floats. +# Author: Edward Bigos +# Date: 2025-0923 + +length = input("Enter a value for length: ") +#print(type(length)) +length = float(length) +# print(type(length)) + +width = float(input("Enter a value for width: ")) + +area = length * width + +print("The area is",area) diff --git a/bigos/lecture20250923/rectangleArea01.py b/bigos/lecture20250923/rectangleArea01.py new file mode 100644 index 0000000..1bc4166 --- /dev/null +++ b/bigos/lecture20250923/rectangleArea01.py @@ -0,0 +1,13 @@ + +# Program: rectangleArea01 +# Objective: Calculate the area of a rectangle using integers. +# Author: Edward Bigos +# Date: 2025-0923 + +length = 4 +width = 3 + +area = length * width + +print(area) +print("The area is",area) diff --git a/bigos/lecture20250923/rectangleArea02.py b/bigos/lecture20250923/rectangleArea02.py new file mode 100644 index 0000000..b67f8e0 --- /dev/null +++ b/bigos/lecture20250923/rectangleArea02.py @@ -0,0 +1,16 @@ + +# Program: rectangleArea02 +# Objective: Calculate the area of a rectangle using integers. +# Author: Edward Bigos +# Date: 2025-0923 + +length = input("Enter a value for length: ") +#print(type(length)) +length = int(length) +# print(type(length)) + +width = int(input("Enter a value for width: ")) + +area = length * width + +print("The area is",area) diff --git a/bigos/lecture20250923/rectanglePerimeter01.py b/bigos/lecture20250923/rectanglePerimeter01.py new file mode 100644 index 0000000..8a34f92 --- /dev/null +++ b/bigos/lecture20250923/rectanglePerimeter01.py @@ -0,0 +1,22 @@ + +# Program: rectanglePerimeter01 +# Objective: Calculate the perimeter of a rectangle using floats. +# Author: Edward Bigos +# Date: 2025-0923 + +print("\nCalculate the perimeter of a rectangle\n") + +length = input("Enter a value for length: ") +#print(type(length)) +length = float(length) +# print(type(length)) + +width = float(input("Enter a value for width: ")) + +perimeter = 2 * (length + width) + +print("\n") + +print("The perimeter is",perimeter) +print(f"The perimeter is {perimeter}") +print(f"The perimeter of length {length} and width {width} is {perimeter}") diff --git a/bigos/lecture20250923/sphereVolume01.py b/bigos/lecture20250923/sphereVolume01.py new file mode 100644 index 0000000..31b2bed --- /dev/null +++ b/bigos/lecture20250923/sphereVolume01.py @@ -0,0 +1,15 @@ + +import math + +print("\nCalculate the volume of a sphere\n") + +PI = math.pi +radius = float(input("Enter a value for radius: ")) + + +volume = 4/3 * PI * radius * radius * radius + +print(f"The volume is {volume}") +print(f"The volume is {volume:.2f}") + +