Past-paper question · 2012 May-June · Paper 22 · Q1(f)

Question 1(f) 2012 · May-June · Paper 22 · 0 marks

Original past-paper question for 1(F)
Original past-paper question for 1(F)
Original past-paper question for 1(F)
Original past-paper question for 1(F)
Original past-paper question for 1(F)
Original past-paper question for 1(F)
Reveal official mark-scheme answer Official mark-scheme answer for 1(F)Official mark-scheme answer for 1(F)Official mark-scheme answer for 1(F)

Official answer for Question 1

Part (f)

Part (f)

✓
(File handling statement – 1 mark; explanation – 1 mark) × 3
✓
e.g. Pascal
✓
AssignFile(Channel, ExternalFileName); –gives the FileName
✓
a
✓
Channel ID through which access can be made
✓
Reset(Channel); –opens existing file
✓
Write(Channel, Record); –writes record to file
✓
Read (Channel, Record); –reads record from file
✓
Seek (Channel, RecordAddress); –goes directly to record at
✓
specified address
✓
CloseFile (Channel); –closes file
✓
e.g. VB 2005
✓
Channel = New FileStream(ExternalFileName,FileMode.Open)
✓
FileReader = New BinaryReader(Channel)
✓
NewFile = New FileStream(ExternalFileName, FileMode.Create
✓
FileWriter = New BinaryWriter (NewFile)
✓
Record.Field = FileReader.ReadString()
✓
Record.Field = FileReader.ReadDecimal()
✓
Record.Field = FileReader.ReadInt32()
✓
FileWriter.Write(Field)
✓
Channel.Close()
✓
FileReader.Close()
✓
FileWriter.Close()
✓
NewFile.Close()
✓
e.g. C#
✓
channel = new FileStream(externalFileName,FileMode.Open)
✓
fileReader = new BinaryReader(channel)
✓
newFile = new FileStream(externalFileName, fileMode.Create
✓
fileWriter = new BinaryWriter (newFile)
✓
record.Field = FileReader.ReadString()
✓
record.Field = FileReader.ReadDecimal()
✓
record.Field = FileReader.ReadInt32()
✓
fileWriter.Write(field)
✓
channel.Close()
✓
fileReader.Close()
✓
fileWriter.Close()
✓
newFile.Close()
[6]
✓
© University of Cambridge International Examinations 2012
✓
Mark Scheme: Teachers’ version
✓
Syllabus
✓
Paper
✓
GCE AS/A LEVEL – May/June 2012
✓
9691

Question 22

Mark scheme 9691_s12_ms_22.pdf →

Show text version of question

Question 1

Part (f)

Question 1

Anna wants to find out about her fellow students’ reading habits. It will be part of her For

Literature coursework. Examiner's Use She will ask questions online, so starts by designing a screen layout. The first four questions will ask for:

  • student’s first name
  • date of birth
  • type of book they prefer (printed, audio-book or e-book)
  • whether student reads novels (yes/no)

Part (f)

The records will be held in a serial file.

Give three statements from a high-level language that may be used for the file handling and explain what each does.

Language

Question 1

Topic relevance

Why this question appears here

82% assigned-topic match · Data types and structures › Files

Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.

Permanent source page: Educate A Change · From 9691_s12_qp_22.pdf

Keep practising this topic