diff --git a/README.md b/README.md index 02dafc3..fafcb44 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,8 @@ -# 2025spcse160 +# 2025 SP CSE160 Lectures + +Lecture code from the 2025SP cse160 Python lectures. + +The directory bigos contains the code for CSE-160-D01 on Tuesday with Edward Bigos. + +The directory cooper contains the code for CSE-160-D02 distance with Jeff Cooper. diff --git a/bigos/lecture20250204/circleArea01.py b/bigos/lecture20250204/circleArea01.py new file mode 100644 index 0000000..e628d9e --- /dev/null +++ b/bigos/lecture20250204/circleArea01.py @@ -0,0 +1,18 @@ +# Program: circleArea01.py +# Author: Edward Bigos +# Date: 02/04/2025 +# Overview: Demo program to calculate the area of a rcircle. +# No units of measurement are defined. +import math + +print("\n\t Program to calculate the area of a circle\n") + +#PI = 3.1415 +PI = math.pi + +radius = float(input("Enter a value for radius: ")) + +area = PI * radius**2 + +print(f"The area is {area}") + diff --git a/bigos/lecture20250204/demo01.py b/bigos/lecture20250204/demo01.py new file mode 100644 index 0000000..8e23576 --- /dev/null +++ b/bigos/lecture20250204/demo01.py @@ -0,0 +1 @@ +print("Hello World") \ No newline at end of file diff --git a/bigos/lecture20250204/rectangle01.py b/bigos/lecture20250204/rectangle01.py new file mode 100644 index 0000000..9091c97 --- /dev/null +++ b/bigos/lecture20250204/rectangle01.py @@ -0,0 +1,17 @@ +# Program: rectangle01.py +# Author: Edward Bigos +# Date: 02/04/2025 +# Overview: Demo program to calculate the area of a rectangle. +# No units of measurement are defined. + +print("\n\t Program to calculate the area of a rectangle\n") + +length = input("Enter a value for the length: ") +length = float(length) + +width = float(input("Enter a value for width: ")) + +area = length * width + +print(f"The area is {area}") + diff --git a/bigos/lecture20250211/floats01.py b/bigos/lecture20250211/floats01.py new file mode 100644 index 0000000..0e9510c --- /dev/null +++ b/bigos/lecture20250211/floats01.py @@ -0,0 +1,65 @@ + +data1 = 6.2 +Data1 = 11.78821988 +DATA1 = 22. +data1 = 6 +data2 = 4 + + +print("-------------Integer addition") + +result = data1 + data2 + +print("The value of data1 is ",data1) +print("The value of data2 is ",data2) +print("The value of result is ",result) + +print("The type of data1 is ",type(data1) ) +print("The type of data2 is ",type(data2) ) +print("The type of result is ",type(result) ) + +print("-------------Integer subtraction") + +result = data1 - data2 + +print("The value of data1 is ",data1) +print("The value of data2 is ",data2) +print("The value of result is ",result) + +print("The type of data1 is ",type(data1) ) +print("The type of data2 is ",type(data2) ) +print("The type of result is ",type(result) ) + +print("-------------Integer multiplication") + +result = data1 * data2 + +print("The value of data1 is ",data1) +print("The value of data2 is ",data2) +print("The value of result is ",result) + +print("The type of data1 is ",type(data1) ) +print("The type of data2 is ",type(data2) ) +print("The type of result is ",type(result) ) + +print("-------------Integer division") + +result = data1 / data2 + +print("The value of data1 is ",data1) +print("The value of data2 is ",data2) +print("The value of result is ",result) + +print("The type of data1 is ",type(data1) ) +print("The type of data2 is ",type(data2) ) +print("The type of result is ",type(result) ) + + + +print("The value of data1 is ",data1) +print("The value of Data1 is ",Data1) +print("The value of DATA1 is ",DATA1) + +print("The type of data1 is ",type(data1) ) +print("The type of Data1 is ",type(Data1) ) +print("The type of DATA1 is ",type(DATA1) ) \ No newline at end of file diff --git a/bigos/lecture20250211/floats02.py b/bigos/lecture20250211/floats02.py new file mode 100644 index 0000000..5fcfb72 --- /dev/null +++ b/bigos/lecture20250211/floats02.py @@ -0,0 +1,53 @@ + +data1 = 6. +data2 = 4. + + +print("-------------Float addition") + +result = data1 + data2 + +print("The value of data1 is ",data1) +print("The value of data2 is ",data2) +print("The value of result is ",result) + +print("The type of data1 is ",type(data1) ) +print("The type of data2 is ",type(data2) ) +print("The type of result is ",type(result) ) + +print("-------------Float subtraction") + +result = data1 - data2 + +print("The value of data1 is ",data1) +print("The value of data2 is ",data2) +print("The value of result is ",result) + +print("The type of data1 is ",type(data1) ) +print("The type of data2 is ",type(data2) ) +print("The type of result is ",type(result) ) + +print("-------------Float multiplication") + +result = data1 * data2 + +print("The value of data1 is ",data1) +print("The value of data2 is ",data2) +print("The value of result is ",result) + +print("The type of data1 is ",type(data1) ) +print("The type of data2 is ",type(data2) ) +print("The type of result is ",type(result) ) + +print("-------------Float division") + +result = data1 / data2 + +print("The value of data1 is ",data1) +print("The value of data2 is ",data2) +print("The value of result is ",result) + +print("The type of data1 is ",type(data1) ) +print("The type of data2 is ",type(data2) ) +print("The type of result is ",type(result) ) + diff --git a/bigos/lecture20250211/inputs01.py b/bigos/lecture20250211/inputs01.py new file mode 100644 index 0000000..7d6238c --- /dev/null +++ b/bigos/lecture20250211/inputs01.py @@ -0,0 +1,18 @@ + +data1 = input("Enter a value for data1 ") +data1 = float(data1) + +data2 = float( input("Enter a value for data2 ") ) + + +print("The value of data1 is ",data1) +print("The value of data2 is ",data2) + + +print("The type of data1 is ",type(data1) ) +print("The type of data2 is ",type(data2) ) + + +result = data1 + data2 + +print(result) \ No newline at end of file diff --git a/bigos/lecture20250211/ints01.py b/bigos/lecture20250211/ints01.py new file mode 100644 index 0000000..b2aa10e --- /dev/null +++ b/bigos/lecture20250211/ints01.py @@ -0,0 +1,13 @@ + +data1 = 6 +Data1 = 11 +DATA1 = 22 + +print("The value of data1 is ",data1) +print("The value of Data1 is ",Data1) +print("The value of DATA1 is ",DATA1) + +print("The type of data1 is ",type(data1) ) +print("The type of Data1 is ",type(Data1) ) +print("The type of DATA1 is ",type(DATA1) ) + diff --git a/bigos/lecture20250211/ints02.py b/bigos/lecture20250211/ints02.py new file mode 100644 index 0000000..1cfb8de --- /dev/null +++ b/bigos/lecture20250211/ints02.py @@ -0,0 +1,53 @@ + +data1 = 6 +data2 = 4 + + +print("-------------Integer addition") + +result = data1 + data2 + +print("The value of data1 is ",data1) +print("The value of data2 is ",data2) +print("The value of result is ",result) + +print("The type of data1 is ",type(data1) ) +print("The type of data2 is ",type(data2) ) +print("The type of result is ",type(result) ) + +print("-------------Integer subtraction") + +result = data1 - data2 + +print("The value of data1 is ",data1) +print("The value of data2 is ",data2) +print("The value of result is ",result) + +print("The type of data1 is ",type(data1) ) +print("The type of data2 is ",type(data2) ) +print("The type of result is ",type(result) ) + +print("-------------Integer multiplication") + +result = data1 * data2 + +print("The value of data1 is ",data1) +print("The value of data2 is ",data2) +print("The value of result is ",result) + +print("The type of data1 is ",type(data1) ) +print("The type of data2 is ",type(data2) ) +print("The type of result is ",type(result) ) + +print("-------------Integer division") + +result = data1 / data2 + +print("The value of data1 is ",data1) +print("The value of data2 is ",data2) +print("The value of result is ",result) + +print("The type of data1 is ",type(data1) ) +print("The type of data2 is ",type(data2) ) +print("The type of result is ",type(result) ) + diff --git a/bigos/lecture20250211/mixed01.py b/bigos/lecture20250211/mixed01.py new file mode 100644 index 0000000..334597b --- /dev/null +++ b/bigos/lecture20250211/mixed01.py @@ -0,0 +1,53 @@ + +data1 = 6 +data2 = 4. + + +print("-------------Float addition") + +result = data1 + data2 + +print("The value of data1 is ",data1) +print("The value of data2 is ",data2) +print("The value of result is ",result) + +print("The type of data1 is ",type(data1) ) +print("The type of data2 is ",type(data2) ) +print("The type of result is ",type(result) ) + +print("-------------Float subtraction") + +result = data1 - data2 + +print("The value of data1 is ",data1) +print("The value of data2 is ",data2) +print("The value of result is ",result) + +print("The type of data1 is ",type(data1) ) +print("The type of data2 is ",type(data2) ) +print("The type of result is ",type(result) ) + +print("-------------Float multiplication") + +result = data1 * data2 + +print("The value of data1 is ",data1) +print("The value of data2 is ",data2) +print("The value of result is ",result) + +print("The type of data1 is ",type(data1) ) +print("The type of data2 is ",type(data2) ) +print("The type of result is ",type(result) ) + +print("-------------Float division") + +result = data1 / data2 + +print("The value of data1 is ",data1) +print("The value of data2 is ",data2) +print("The value of result is ",result) + +print("The type of data1 is ",type(data1) ) +print("The type of data2 is ",type(data2) ) +print("The type of result is ",type(result) ) + diff --git a/bigos/lecture20250211/outputs01.py b/bigos/lecture20250211/outputs01.py new file mode 100644 index 0000000..6d2d7f3 --- /dev/null +++ b/bigos/lecture20250211/outputs01.py @@ -0,0 +1,27 @@ + +data1 = input("Enter a value for data1 ") +data1 = float(data1) + +data2 = float( input("Enter a value for data2 ") ) + + +print("The value of data1 is ",data1) +print("The value of data2 is ",data2) + + +print("The type of data1 is ",type(data1) ) +print("The type of data2 is ",type(data2) ) + + +result = data1 + data2 + +print(result) + +print("The result is ",result) +# Wrong -- forgot braces +print(f"The result is result") + +print(f"The result is {result}") +print(f"The result is {result:.2f}") +print(f"The result is ${result:.2f}") + diff --git a/bigos/lecture20250211/strings01.py b/bigos/lecture20250211/strings01.py new file mode 100644 index 0000000..fefbb00 --- /dev/null +++ b/bigos/lecture20250211/strings01.py @@ -0,0 +1,24 @@ + +message1 = "This is a sample message string." + +message2= 'This is another sample message string.' + +multiLineMessage = '''This is a long paragraph +of text to +display +''' + +print("message1 ") +print(type(message1)) +print(message1) + +print("message2 ") +print(type(message2)) +print(message2) + +print("multiLineMessage ") +print(type(multiLineMessage)) +print(multiLineMessage) + + + diff --git a/bigos/lecture20250211/strings02.py b/bigos/lecture20250211/strings02.py new file mode 100644 index 0000000..605697a --- /dev/null +++ b/bigos/lecture20250211/strings02.py @@ -0,0 +1,21 @@ + +message1 = "This is a sample message string." + +message2= 'This is another sample message string.' + +multiLineMessage = '''This is a long paragraph +of text to +display +''' + +print("message1 ") +print(type(message1), len(message1)) +print(message1) + +print("message2 ") +print(type(message2),len(message2)) +print(message2) + +print("multiLineMessage ") +print(type(multiLineMessage),len(multiLineMessage)) +print(multiLineMessage) \ No newline at end of file diff --git a/bigos/lecture20250211/strings03.py b/bigos/lecture20250211/strings03.py new file mode 100644 index 0000000..9184afd --- /dev/null +++ b/bigos/lecture20250211/strings03.py @@ -0,0 +1,53 @@ + +message1 = "This is a sample message string." + +message2= 'This is another sample message string.' + +multiLineMessage = '''This is a long paragraph +of text to +display +''' + +msg = message1 + message2 + +print("message1 ") +print(type(message1), len(message1)) +print(message1) + +print("message2 ") +print(type(message2),len(message2)) +print(message2) + +print("msg ") +print(type(msg),len(msg)) +print(msg) + +print("\n") + + +msg = message1 * 3 + +print("message1 ") +print(type(message1), len(message1)) +print(message1) + +print("message2 ") +print(type(message2),len(message2)) +print(message2) + +print("msg ") +print(type(msg),len(msg)) +print(msg) + +borderStars = "*" * 60 +print(borderStars) + +borderMain = "*" + " " * 58 + "*" +print(borderMain) +print(borderMain) +print(borderMain) +print(borderMain) +print(borderMain) + +print(borderStars) + diff --git a/bigos/lecture20250211/strings04.py b/bigos/lecture20250211/strings04.py new file mode 100644 index 0000000..46a9f36 --- /dev/null +++ b/bigos/lecture20250211/strings04.py @@ -0,0 +1,22 @@ + +data1 = "6" +data2 = 4 + + +print("The value of data1 is ",data1) +print("The value of data2 is ",data2) + + +print("The type of data1 is ",type(data1) ) +print("The type of data2 is ",type(data2) ) + +# Generates an error +#result = data1 + data2 + +# Works as long as data1 can be converted to an integer +result = int(data1) + data2 + +# Works as long as you want string concatenation +result = data1 + str(data2) + +print(result) \ No newline at end of file diff --git a/jlcooper/README.md b/jlcooper/README.md new file mode 100644 index 0000000..e69de29