A quiz program keeps its high scores in a Python list named scores. At the moment the program contains no code that writes anything to storage. Which of the following statements are true? Select all that apply.
When the program ends, the high-score list is lost, because it existed only in memory.
Restarting the program brings the list back, because Python keeps variables from the previous run.
Saving only in code that runs on a normal exit would still lose that run's new scores in a crash.
Updating the list in memory more often would let the scores survive a power failure.
The number of stored scores can be recomputed after loading the list, so it need not be saved separately.
Unlock full course notes by signing up
Strokes lost when a drawing app crashes
A drawing app autosaves every 8 minutes, with the first autosave 8 minutes after launch, and each save completes instantly. The user draws continuously, adding about 35 strokes per minute. The app crashes 30 minutes after launch, and on restart it loads the most recent save. How many strokes are lost? Give your answer as a whole number of strokes.
Track separate saved copies
A student has a flashcard app on a laptop and a tablet. Initially, each device has a saved copy of the same 14 cards. Each device stores its own collection persistently; there is no automatic synchronization.
All new cards are distinct. Adding cards changes only the named device, and every addition below is successfully saved. A manual copy from laptop to tablet replaces the tablet's entire saved collection with the laptop's saved collection; it does not combine them or change the laptop.
Complete the table with the number of saved cards on each device immediately after each event. The events occur in the listed order, and each row continues from the preceding row. Enter exact whole numbers.
Save size and write volume for a puzzle game
A puzzle game saves its state as 1200 records of 96 bytes each plus a 128-byte header. A save starts at launch (t=0t = 0t=0 minutes) and every 3 minutes thereafter, recording the state at the moment it starts. Writing each file takes 30 seconds. The game writes each save to a temporary file and replaces the previous save only when the write finishes, so a crash during a write leaves the previous complete save on disk. Consider the first hour to be 0≤t<600 \leq t < 600≤t<60 minutes. Using 1 MB = 1,000,000 bytes, find: the size of one save in bytes (whole number), the number of saves started during this hour (whole number), the total data written during this hour in MB (to two decimal places), and the worst-case amount of play lost in a crash after the launch save has finished, in minutes (to one decimal place).
Recover from an older backup
A school archive app has 160 distinct records in its primary saved collection. A complete backup of that collection is made on a separate removable drive, which is then disconnected.
During the following week, an administrator deliberately deletes 12 of those original records and adds 27 new, distinct records. Both changes are successfully saved to the primary collection. The administrator wants exactly this updated collection, including those deletions.
The storage device holding the primary collection then fails and becomes unreadable. The separate backup remains intact. There is no usable in-memory copy or other source for recovering records. The app restores the entire backup without making any further changes.