Practice question · Sort into groups
Sort each action by whether it is input or output.
Groups: Input · Output
- Reading numbers from a file
- Sending a message over the network
- Writing a report to a file
- Printing a result to the screen
- Reading a line the user typed
- Receiving a message over the network
Hints
- Ask whether data is coming into the program or leaving it.
- The same medium, a file or a network, can carry data in either direction.
Show the answer
Input: Reading a line the user typed, Reading numbers from a file, Receiving a message over the network
Output: Printing a result to the screen, Writing a report to a file, Sending a message over the network
Why
Reading and receiving bring data in; printing, writing and sending push data out. The medium does not decide the direction, a file or network can be read (input) or written (output), so the verb is what matters.
Practise Input, Output, and File Thinking
The app has 5 more questions on this lesson, and keeps your place in the course. Computer Science I is free to start.
More questions on Input, Output, and File Thinking
- The open-process-close discipline requires closing a file even when processing fails partway through. Why…
- Match each I/O idea to what it means.
- A program writes to a file, crashes, and the file turns out empty, although the writes clearly executed.…
- Select every statement that is true of the stream model and file handling.
- Order the steps a program takes to read a number from the user and add ten to it.