Slide 7 of 12
Upgrade Your Joke Bot!
AI6-M3: Database Integration
Digital Technologies / Information Communication Technologies

## Classroom Guidelines

### How Points Are Earned:

+2 Points - You attended class

+1 Point - You listened quietly during instruction

+1 Point - You attempted all assigned work

+1 Point - You completed all assigned work

Maximum: 5 points per class session

## Learning Outcomes

By the end of this lesson, you will be able to:

1. Download a project from the internet (using Git clone)
2. Open and understand a Python program (starter_app.py)
3. Make simple changes to make the program better
4. Save your work to the internet (using Git push)

## Why This Matters

- Learn how real programmers work together
- Understand how apps remember things (using databases)
- Practice following step-by-step instructions
- Create something that actually works!
- These skills help with school projects and future jobs

Who uses these skills?

Every app on your phone (Instagram, TikTok, games) needs databases to remember your information!

## Step 1: Find Our Project Online

Every project has a special web address (URL)

💡 IMPORTANT: You MUST use this exact address:
`https://gitea.techshare.cc/technolyceum/ai6-m3.git`

Think of it like:

- This is our project's "home" on the internet
- Like downloading a game from the App Store
- We're getting all the files we need to start

What's inside this address?

# Inside this address you'll find: 📁 ai6-m3-project/ ├── 📄 starter_app.py ← The joke bot you'll upgrade! ├── 📄 requirements.txt ← List of things needed ├── 📄 README.md ← Instructions └── 📄 .gitignore ← Special settings file

## Step 2: Download to Your Computer

Using "Git Clone" - like copying a folder from the internet

Open Command Prompt (Windows):

Press `Windows Key`, type `cmd`, press `Enter`

Go to Desktop:

# Type this to go to your Desktop: cd Desktop # Check you're on Desktop: dir # You'll see your Desktop files

DOWNLOAD THE PROJECT:

# Copy everything from the internet to your computer: git clone https://gitea.techshare.cc/technolyceum/ai6-m3.git # This creates a folder called "ai6-m3" on your Desktop

Check it worked:

cd ai6-m3 dir # You should see "starter_app.py" in the list!

## Step 3: Open the Joke Bot Program

Let's see what we're working with!

Using VS Code (or any text editor):

# Make sure you're in the right folder: cd Desktop\ai6-m3 # Open the folder in VS Code: code . # Or open VS Code and use File → Open Folder

Look for this file:

📁 ai6-m3/ └── 📄 starter_app.py ← DOUBLE CLICK THIS!

What you'll see:

- A Python program that tells jokes
- Right now, it only has 3 jokes
- We're going to make it remember MORE jokes

Try running it first:

python starter_app.py # It should tell you a random joke!

## Step 4: Upgrade Your Joke Bot!

Make it remember jokes using a database

Your mission:

1. Add at least 5 new jokes to the program
2. Make it remember jokes even after you close it
3. Test that it works!

Simple changes to make:

# In starter_app.py, find this part: jokes = [ "Why don't scientists trust atoms?...", "Why did the chicken cross the road?...", "What do you call fake spaghetti?..." ] # ADD YOUR JOKES HERE! "Your first joke here", "Your second joke here", "Keep adding more!" # Don't forget the comma at the end!

Database part (teacher will help):

# We'll add code to save jokes to a file # So jokes don't disappear when you close the program

## Step 5: Save Your Work Online

Using Git - like saving to the cloud

First, check what you changed:

# Make sure you're in ai6-m3 folder: cd Desktop\ai6-m3 # See what files you changed: git status # It will show "starter_app.py" in red or green

Step 1: Tell Git about your changes

git add . # This means: "Save ALL my changes" # The dot (.) means "everything in this folder"

Step 2: Give your work a title

git commit -m "Upgraded app for database implementation" # This is like putting your name on your work # "Upgraded app for database implementation" is your title

Step 3: Send it online

git push # This sends your work back to the internet # Now everyone can see your upgraded joke bot!

## What You Learned

In this lesson, you have learned how to:

1. Download a project from the internet using a special address
2. Open and run a Python program on your computer
3. Add new jokes to make the program better
4. Save your work and share it online using Git

Key Takeaways:

You now know the basic workflow of real programmers: Download → Modify → Save → Share. This is how all apps and games get made!

🎉 CONGRATULATIONS!
You just completed your first programming project upgrade!

## Questions & Discussion

Review what we covered:

- What was the most fun part of upgrading the joke bot?
- Did your jokes make your friends laugh?
- What other things would you like a bot to remember?
- Was Git push confusing? What part?

Common Issues:

- Forgot commas between jokes? → Add them!
- Git says "not a git repository"? → Make sure you're in ai6-m3 folder!
- Python won't run? → Check for typos in your code

Need Additional Help?

Raise your hand! Ask your neighbor! The teacher is here to help!

# Great Job! 🎉

Thank you for being awesome programmers today!

Your Joke Bot is now upgraded and saved online!

🌟 YOU DID IT! 🌟
You downloaded code, made it better, and saved it for everyone to see!

Next Steps:

- Show your joke bot to family or friends
- Think of other cool upgrades (maybe add puns?)
- Be proud - you just did real programming!

Digital Technologies / ICT
Grade 5-8 | Beginner Programmers