Activity 01
Pair Challenge: High-Score Tracker
Pairs write a program that asks for a name and score, then appends it to 'highscores.txt'. Test by running multiple times and viewing the file. Discuss why 'a' mode prevents data loss.
Justify the need for data persistence in applications like a high-score tracker.
Facilitation TipDuring the Pair Challenge, circulate with a file explorer open on your device to show students where to look for their saved files after each write.
What to look forProvide students with a scenario: 'You are building a simple diary application. What file mode would you use to add a new entry each day without losing previous entries, and why?' Students write their answer on a slip of paper.