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 秒で採点します。

同じような問題をもっと解きたい?このトピックの新しい問題を、解きながら採点。

練習を始める