1.1 HW Hacks
Algorithms (1.1) Homework Hacks
Hack 1
Chosen algorithm: Making a pizza from scratch
- Go to the store
- Get tomato sauce, cheese, and pizza bread
- Go back to the place where the pizza will be made
- Get supplies ready
- Put sauce on pizza bread
- Spread the sauce so it covers the entire pizza
- Put cheese on top of sauce so that it covers the entire pizza
- Place pizza on a tray
- Warm the oven to 450°F
- Put tray with pizza in the oven for 15 minutes
- Take pizza out
- Cut pizza in half horizontally
- Cut pizza in half vertically
- Cut pizza diagonally from the left
- Cut pizza diagonally from the right
Hack 2
Fixed algorithm:
- Open email application
- Log into your account
- Enter recipient's email address
- Write subject line
- Type the message
- Click send
Hack 3
print("Enter score 1: ")
scoreOne = int(input())
print("Enter score 2: ")
scoreTwo = int(input())
print("Enter score 3: ")
scoreThree = int(input())
averageScore = (scoreOne + scoreTwo + scoreThree) / 3
if averageScore >= 90:
print("Grade is A")
elif averageScore >= 80:
print("Grade is B")
elif averageScore >= 70:
print("Grade is C")
elif averageScore >=60:
print("Grade is D")
else:
print("Grade is F")
Enter score 1:
Enter score 2:
Enter score 3:
Grade is F