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

Question 1(f) 2012 · May-June · Paper 23 · 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)
Reveal official mark-scheme answer 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) × 4
✓
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()
[8]
✓
© University of Cambridge International Examinations 2012
✓
Mark Scheme: Teachers’ version
✓
Syllabus
✓
Paper
✓
GCE AS/A LEVEL – May/June 2012
✓
9691

Question 23

Mark scheme 9691_s12_ms_23.pdf →

Show text version of question

Question 1

Part (f)

Question 1

Anna wants to find out about her fellow students' sporting activities. It will be part of her For

Sports Studies 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
  • age (16,17,18 or 19)
  • favourite sport
  • whether student is a member of a sports club (yes/no)

Part (f)

The records will be held in a direct access file. For

Give four statements from a high-level programming language that may be used for Examiner's Use the file handling and explain what each does.

Programming 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_23.pdf

Keep practising this topic