Input, Output and Validation | Edexcel International GCSE Computer Science (4CP0)
Guide overview All 20 topics Sample questions Papers and weighting Look inside Questions and answers
Input, Output and Validation
- 30 questions
- 3 subtopics
- Paper 1
- Paper 2
Input, Output and Validation is examined in Paper 1, Principles of Computer Science, and Paper 2, Application of Computational Thinking.
It covers user input and output; validation; and text files.
Sample questions from Input, Output and Validation
Answer each one closed book first, then open the answer.
-
User input and output
How does a Python program accept input from the user?
Show the answer
The input function displays a prompt and waits for the user to type. The value is returned as a string. -
User input and output
Why should a program display a prompt before asking for input?
Show the answer
A prompt tells the user what to type and in what form. Users make fewer mistakes when they know what is expected. -
Validation
What is validation?
Show the answer
Validation is an automatic check by a program that input data is reasonable and follows set rules before it is accepted. -
Validation
What is a presence check?
Show the answer
A presence check makes sure that a required field has not been left empty. -
Text files
Why do programs read and write text files?
Show the answer
Data in variables is lost when a program closes. Writing to a file stores the data permanently so it can be read back later. -
Text files
Why should a file be closed after use?
Show the answer
Closing the file saves any data still waiting to be written. Other programs can then use the file.
The 3 subtopics
One subtopic is one session. Work down the list.
| Subtopic | What it covers | Questions |
|---|---|---|
| User input and output | Accepting and responding to user input, prompts, casting input, menus and displaying output with SEND. | 8 |
| Validation | Why validation is needed, range, length, presence, type, format and lookup checks, and coding a validation loop. | 11 |
| Text files | Reading and writing text files in Python and pseudocode, write and append modes, splitting lines and file errors. | 11 |
How the guide is worked
Answering a question from memory stores it far better than reading the answer again. The guide runs that as a fixed procedure on one subtopic at a time, about twenty minutes a session.
-
Step 1 · Closed book
Cover the answers. Work through one subtopic and write down what you can. Leave blanks where you have nothing.
-
Step 2 · Open book
Go back to the top. Read each printed answer and write it out in full, including the ones you had right.
-
Step 3 · Closed book again
Same questions, same order, from memory. The gap between pass one and pass three is the session result.
Read the full method, the return schedule and the research behind it.
Around this topic
Edexcel International GCSE Computer Science Active Recall Guide
Input, Output and Validation and every other topic, with the answers printed after each section.