File Handling in Procedures

Continuation activities focused on writing and reading files inside procedures.

Activity 1: Parsons Problem - SaveLogs Procedure

Drag the lines into the correct order to define SaveLogs(code, dob, filename).

Code Bank

Your Procedure

Activity 2: Call SaveLogs Correctly

Starter code is provided. Add the correct procedure call that passes code, dob, and filename.

File Output View

pilots.txt

        

Activity 3: Parsons Problem - DisplayPilots Procedure

Reorder the lines so the procedure reads from a file line-by-line and prints each pilot record.

Code Bank

Your Procedure

Activity 4: Call DisplayPilots Correctly

Use the starter code and correctly call DisplayPilots so records from pilots.txt are shown.


          
        

Editable File View

pilots.txt