Week 9 Lesson 2 Challenge
YEAR 9 DIGITAL TECHNOLOGIES • FILES CHALLENGE
Save the Booking Challenge
In this challenge, you will use files to save booking data into a CSV file.
🐾 SCENARIO
Imagine you are writing a Python program for the Pet Services business.
The business needs a simple booking system.
Right now, if the program closes, the booking disappears.
Your job is to make the booking stay saved by writing it into a file called bookings.csv.
🎯 YOUR GOAL
Build a program that follows these rules:
- Ask for the customer name.
- Ask for the service booked.
- Check whether bookings.csv already exists.
- If it exists, add the new booking to it.
- If it does not exist, create bookings.csv and start saving bookings in it.
💭 WHAT YOU SHOULD THINK ABOUT
- What happens to normal variables when the program ends?
- How can a program tell whether a file already exists?
- When should the program create a new file?
- When should it add to an existing file instead?
- What should each line in a CSV file look like?
- What message should the program print so the user knows the booking was saved?
📌 SUCCESS CRITERIA
- Your program asks for a customer name and service.
- Your program checks whether bookings.csv exists.
- If the file exists, your program appends the booking.
- If the file does not exist, your program creates it.
- The file saved is a .csv file.
- Your output is clear and readable.
💬 WHAT TO POST IN REPLY BELOW
- Your code attached as a .py file
- A screenshot or a copy of your bookings.csv file after at least 2 bookings
✅ REMEMBER
This challenge is about making the booking survive after the program closes.
Keep the system simple. Save the booking correctly first.