Practice and reinforce the concepts from Lesson 4
Time Needed: 30-40 minutes
What You'll Create: A smart roller coaster entry system that checks if riders meet the requirements!
In this activity, you'll become a theme park programmer! You'll create a roller coaster queue system using conditional statements. Imagine you're building the software that automatically checks if riders can safely enjoy the ride. You'll learn to use if-else statements and logical operators to create decision-making programs that keep everyone safe and happy!
Go to EduBlocks and login with your Google account: https://app.edublocks.org/login
Start Your Project:
Configure Your Project:
:bulb: :bulb: Save Often! Click the save button every few minutes to keep your progress safe. Lost work is no fun!
Steps to Complete Your Roller Coaster Queue System
Part One: Basic Queue System - Age Requirement :emoji:
Let's build a simple age checker first! Your program will ask riders their age and decide if they can ride.
The Rule: Riders must be at least 12 years old
Step-by-Step Instructions:
- Create an age variable:
- Drag the
variable
block from the Variables section- Name it
age
- Connect it to an
input
block with the question: "What is your age?"- Convert to integer:
- Wrap your input with an
int()
block (find it in the Math section)- This changes text to a number so we can compare it!
- Add the IF statement:
- Drag an
if
block from the Control section- Inside, create the condition:
age >= 12
- Use the comparison blocks from the Logic section
- Add the messages:
- Inside the IF block: drag a
- Add an
else
block below- Inside ELSE: drag a
Now let's make our system smarter! Some shorter riders might be very brave and mature, so we'll add a height option.
The New Rules: Riders can enter if:
Step-by-Step Instructions:
Keep your age variable from Part 1
Add a height variable:
variable
blockheight
input
block with: "What is your height in cm?"int()
just like you did with age!Modify your IF condition:
or
block in the Logic sectionage >= 12 or height >= 150
Keep the same messages:
:bulb: :dart: Pro Tip: The OR operator is like having two keys to a door - you only need ONE to work! If either condition is true, the rider can enter. This is different from AND, which would need BOTH conditions to be true.
Pattern Recognition Challenge: Notice how creating the height variable is exactly like creating the age variable? That's pattern recognition in action! :mag:
Troubleshooting Tips :hammer_and_wrench:
Common Issues and Solutions:
- "My program crashes when I enter my age!"
- Make sure you wrapped your input with the
int()
block- Check that your variable name matches everywhere you use it
- "The IF statement isn't working!"
- Double-check your comparison operator (>= not just >)
- Make sure the number 12 or 150 is in the right spot
- "I can't find the OR block!"
- Look in the Logic section (usually has a lightbulb icon)
- It might be called "or" or show as a symbol
- "My blocks won't connect!"
- Make sure you're dragging compatible blocks together
- The shapes should match like puzzle pieces
Required Elements :white_check_mark:
Make sure your Roller Coaster Queue System includes:
- Basic version: Age input with integer conversion and conditional checking
- If-else statements with appropriate messages ("Have fun!" or "Sorry, no entry!")
- Advanced version: Height input variable with logical operators
- Combined conditions using OR logic for entry requirements
- Proper input validation and integer conversions
:trophy: Challenge Yourself!
Ready for some extra challenges? Try these:
- Super Safety Mode:
- Add BOTH age AND height requirements (use the AND operator)
- Riders must be at least 12 AND at least 150cm tall
- VIP Fast Pass:
- Ask if they have a VIP pass (yes/no)
- VIP pass holders can skip all requirements!
- Custom Messages:
- If they're too young, tell them how many years to wait
- If they're too short, tell them how many cm they need to grow
- Real Python Connection:
- In real Python, this would look like:
python
if age >= 12 or height >= 150: print("Have fun!") else: print("Sorry, no entry!")
- See how similar your blocks are to real code? You're learning real programming! :emoji:
Project Submission :emoji:
Ready to submit? Great job completing your Roller Coaster Queue System!
Test both versions before submitting:
- Basic version (age only)
- Advanced version (age OR height)
Submit your projects here: Submit Your Project Here
Remember: You need to submit 2 project links - one for each version!tip :tada: Celebration Time! You've just programmed a real decision-making system! Theme parks actually use similar logic in their automated systems. You're becoming a real programmer!