Creative Programming
Spring 2025
CUL1122 Lecture #03
Lab 3
Today
❖1) Movie Ticket Pricing
❖2) Snack Vending Machine
❖3) Music Playlist Recommendation
❖4) Restaurant Tip Calculator
❖5) Weather Outfit Suggestion
3
Exercise #1: Movie Ticket Pricing
❖Create a script that determines the ticket price based on the person’s
age.
▪ The script takes an age as input and outputs the corresponding ticket price.
▪ Price categories:
➢Children (0-12): $5
➢Teens (13-17): $7
➢Adults (18-64): $10
➢Seniors (65+): $6
4
Exercise #2: Snack Vending Machine
❖Create a script where the user selects a snack, and the program displays
its price.
▪ The script takes a snack name as input and outputs the corresponding price.
▪ Snack Prices:
➢Pretzels: $4
➢Chips: $2
➢Soda: $1.5
➢Candy: $1
5
Exercise #3: Music Playlist Recommendation
❖Create a script that suggests a playlist based on the user’s mood.
▪ The script takes the user’s mood as input and recommends a playlist.
▪ Mood-Based Playlists:
➢Energetic → Workout Mix
➢Romantic → Love Songs
➢Happy → Upbeat Hits
➢Sad → Chill & Relax
6
Exercise #4: Restaurant Tip Calculator
❖Create a script that suggests a tip percentage based on service quality.
▪ he script takes the bill amount and service quality as input and calculates the
tip.
▪ Service Quality & Tip Percentage:
➢Poor → 5%
➢Average → 10%
➢Good → 15%
➢Excellent → 20%
7
Exercise #5: Weather Outfit Suggestion
❖Create a script that recommends an outfit based on the weather
temperature.
▪ The script takes the temperature as input and suggests an appropriate outfit.
▪ Temperature & Outfit Recommendations:
➢Above 30°C → Wear shorts and stay cool!
➢21-30°C → Wear a t-shirt and jeans.
➢10-20°C → Wear a light jacket.
➢Below 10°C → Wear a heavy coat and scarf.
8
수고하셨습니다!