Popcorn Hack/interctive portion

Homework Hack 1
Algorithm: Getting Ready for a Basketball Game
-
Put on your uniform.
-
Pack your bag with water, towel, and gear.
-
Eat a light meal for energy.
-
Fill your water bottle.
-
Sretch to warm up.
-
Change into clean game clothes.
-
Go to the gym early.
-
Tie your shoes and get ready to play.
Homework Hack 2
Corrected Algorithm: Send an Email
-
Open email application
-
Log into your account
-
Enter recipient’s email address
-
Write subject line
-
Type the message
-
Click “Send”
Homework Hack 3
def calculate_grade(score1, score2, score3):
"""
Calculate letter grade from three test scores.
"""
# Step 1: Add the three scores together
total = score1 + score2 + score3
# Step 2: Calculate the average
average = total / 3
# Step 3: Determine the letter grade
if average >= 90:
grade = 'A'
elif average >= 80:
grade = 'B'
elif average >= 70:
grade = 'C'
elif average >= 60:
grade = 'D'
else:
grade = 'F'
# Step 4: Return the grade
return grade
# Test the function
print("Test 1:", calculate_grade(95, 92, 88)) # A
print("Test 2:", calculate_grade(85, 80, 82)) # B
print("Test 3:", calculate_grade(75, 70, 72)) # C
print("Test 4:", calculate_grade(65, 60, 62)) # D
print("Test 5:", calculate_grade(55, 50, 52)) # F
Test 1: A
Test 2: B
Test 3: C
Test 4: D
Test 5: F