Hack 1: Create Your Own Algorithm
-
Activity chosen: Setting up a new phone
-
Algorithm: Setting up a New Phone
-
Unbox the new phone and remove protective covers.
-
Press and hold the power button until the screen lights up.
-
Choose your preferred language and region.
-
Connect to a Wi-Fi network for setup.
-
Log in with your Google or Apple account.
-
Restore data from a previous backup (if available).
-
Set up security options (PIN, fingerprint, or face ID).
-
Install essential apps from the app store.
-
Customize home screen and settings.
-
Test calling, texting, and internet to confirm setup success.
Hack 2: Identify the Bug
Original Algorithm: Send an Email
-
Click “Send”
-
Open email application
-
Type the message
-
Log into your account
-
Enter recipient’s email address
-
Write subject line
Corrected Algorithm: Send an Email
-
Open email application
-
Log into your account
-
Click “Compose” or “New Email”
-
Enter recipient’s email address
-
Write subject line
-
Type the message
-
Review the email for mistakes
-
Click “Send”
Hack 3: Code the Algorithm
def calculate_grade(score1, score2, score3):
"""
Calculate letter grade from three test scores
Args:
score1, score2, score3: Test scores (integers)
Returns:
grade: Letter grade (string)
"""
# 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 using if-elif-else
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 your function!
print("Test 1:", calculate_grade(95, 92, 88)) # Should be 'A'
print("Test 2:", calculate_grade(85, 80, 82)) # Should be 'B'
print("Test 3:", calculate_grade(75, 70, 72)) # Should be 'C'
print("Test 4:", calculate_grade(65, 60, 62)) # Should be 'D'
print("Test 5:", calculate_grade(55, 50, 52)) # Should be 'F'
Test 1: A
Test 2: B
Test 3: C
Test 4: D
Test 5: F