Cambridge IGCSE · Computer Science (0478)

File handling:练习题

5 道选择题即时批改,另有 5 道文字题附完整解题步骤,全部围绕「File handling」。

10 道题目22 免费,无需注册
第 1 题
1

In pseudocode, which command is used to record a data item into an external file that has already been opened?

第 2 题
1

A programmer needs to store a list of 1000 product IDs. Which statement best explains why they should use a file instead of only using a 1D array in the program?

第 3 题
1

Which statement is true regarding file handling as defined in the Cambridge IGCSE syllabus?

第 4 题
1

In the pseudocode command READFILE "Results.txt", StudentScore, what is the specific role of StudentScore?

第 5 题
1

Which of the following describes the correct function of the READFILE command in pseudocode?

第 6 题
2

State the pseudocode command used to read a data item from an external file and explain the role of the variable that must be provided with this command.

先自己写一遍答案,再对照解题步骤。

第 7 题
3

A programmer needs to update a configuration file. Explain why opening a file in WRITE mode could be problematic if the file already contains important existing data.

先自己写一遍答案,再对照解题步骤。

第 8 题
5

Explain two technical reasons why a programmer must include the CLOSEFILE command after a program has finished processing data in a file.

先自己写一遍答案,再对照解题步骤。

第 9 题
3

A data logger records temperature values and stores them in a text file named "LogData.txt".

(a) State the pseudocode command and the specific mode used to open this file if the programmer wants to retrieve existing data from it.
(b) Name the specific pseudocode command used to read a single data item from this file into a variable.
(c) State the command used to finalize the process and release the file back to the system.

先自己写一遍答案,再对照解题步骤。

第 10 题
4

A school uses a text file named "StudentData.txt" to store the names of students in a class. There are exactly \(30\) students. A program is required to read these names and transfer them into a 1D array for easier access during the school day.

Write a pseudocode algorithm that:
- Declares a 1D array named StudentNames with \(30\) elements.
- Opens the file "StudentData.txt" in the appropriate mode.
- Uses a count-controlled loop to read all names from the file and store each name into the array.
- Closes the file after the operation is complete.

先自己写一遍答案,再对照解题步骤。

* thinka 提供的内容由 AI 生成,未必在任何情况下都完全准确或最新,请结合官方教材与教师指导使用。

你已看过标准答案。现在轮到你的答案被批改。

这一页能告诉你好答案是什么样子,却无法指出你的答案缺了什么。thinka 按真实评分标准批改你的文字答案,约 15 秒完成。

想多做几道同类题目?立即开始练习这个课题,边做边批改。

立即练习