1/75
Cambrdige AS level computer science 2025. Textbook references: Cambridge International AS and A level computer science coursebook Sylvia Langfield, David Duddell 2019 press ||| Cambrdige International AS and A Levels Computer science by David Wastson, Helen Williams press 2019
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
why are data types important
helps the computer and the user understand the information
what data type is for numbers
integer
what data type is for one letter or one symbol
char
what data type is for mainly words
string
what data type is for decimal
real
what data type is for yes and no or true and false
Boolean
what data type is for a specific date
date
what data type would you for your name
string
what data type would you use for the number of children in a class
integer
what data type would you use for the time taken to run a race
date/time
what data type would you use for whether a door is opened or closed
boolean
what data type would you use for your birthday
date
what is a record
composite date type comprising several related items
what is a random file
file that stores records at specific addresses that can be accessed directly
what is a binary file
where we store records serially or sequentially
what do we use files for
store and read lines of text
what do text files allow you to write
strings in serial or sequential manner
where can you append strings to a file
at the end of the file
what does this do(pseudocode): OPENFILE <filename> FOR WRITE
create a file and open it for writing
what does this do(pseudocode):OPENFILE <filename> FOR APPEND
open a file in append mode
what does this do(pseudocode): OPENFILE <filename> for read
open a file for reading
what does this do(pseudocode): OPENFILE <filename> FOR RANDOM
open a file for random acces
what does this do(pseudocode): CLOSEFILE <filename>
close a file
what does this do(pseudocode): PUTRECORD <filename>, <identifier>
write a record to a file
what does this do(pseudocode): GETRECORD <filename>, <identifier>
read a record from a file
what does this do(pseudocode): SEEK <filename>, <address>
move to a specific disk address within the file
what does this do(pseudocode): EOF(<filename>)
test for end of file
What is going on here?
Dim fileNum As Integer = FreeFile()
FileOpen(fileNum, "filename.txt", OpenMode.Output)
create a file and open for writing
What is going on here?
Dim fileNum As Integer = FreeFile()
FileOpen(fileNum, "filename.txt", OpenMode.Append)
PrintLine(fileNum, "New data")
opening a file in append mode
What is going on here?
Dim fileNum As Integer = FreeFile()
FileOpen(fileNum, "filename.txt", OpenMode.Input)
Dim line As String
Do While Not EOF(fileNum)
line = LineInput(fileNum)
Console.WriteLine(line)
Loop
opening a file for reading
What is going on here?
Dim fileNum As Integer = FreeFile()
Dim recordLength As Integer = Len(New Student())
FileOpen(fileNum, "students.dat", OpenMode.Random, , , recordLength)
opening a file for random access
What is going on here?
FileClose(fileNum)
closing a file
What is going on here?
Dim student As Student
student.Name = "Alice"
student.ID = 101
FilePut(fileNum, student, recordNumber)
writing a record to a file
What is going on here?
Dim student As Student
FileGet(fileNum, student, recordNumber)
Console.WriteLine($"Name: {student.Name}, ID: {student.ID}")
reading a record from a file
What is going on here?
Seek(fileNum, address)
moving to a specific position (random access)
What is going on here?
If EOF(fileNum) Then
Console.WriteLine("End of file reached.")
End If
testing for the end of a file
what does lineinput(filenum) do
reads one line
what is append mode
opening a file so that new data is added to the end of the existing content in the file
what is sequential file processing
a way of saving records on a disk before the program quits in order so you don’t lose the data
uses for append mode
saving user input over multiple sessions
what kind of array does random-access file processing use
fixed-length records
why does random-access file processing use fixed-length records
allows computer to directly calculate the position of any record in the file
what does random-access file processing do
store each record in a binary file as the record is created
what can a hashing function calculate
address from the record key and store the record at the calculated address
what does READ do in file handling
read data from the file
what does WRITE do in file handling
writes data to the file
what is the disadvantage of using WRITE when you opened a file
overwrites the data
what is a positive when using APPEND when opening a file
does not overwrite the data
what does APPEND do in file handling
adds data to the end of the file i
is a 1D array a list or table
list
is a 2D array a list or table
table
what is flowchart symbol?
flowline
what is flowchart symbol?
terminal
what is flowchart symbol?
process
what is flowchart symbol?
decision
what is flowchart symbol?
input/output
what is flowchart symbol?
annotations
what is flowchart symbol?
predefined process
what is flowchart symbol?
on-page connector
what is flowchart symbol?
off-page connector
what is flowchart symbol?
delay
what is flowchart symbol?
alternate process
what is flowchart symbol?
data
what is flowchart symbol?
document
what is flowchart symbol?
multi-document
what is flowchart symbol?
preparation
what is flowchart symbol?
display
what is flowchart symbol?
manual input
what is flowchart symbol?
manual operation
what is a flowchart
shapes linked together to represent the sequential steps of an algorithm
what is a flowline for
shows the process’ direction. connects two blocks
what is a terminal symbol for
indicates beginning or end of a flowchart
what is a process symbol for
represent a step
what is a decision symbol for
shows a step that decides the next step in a process. Commonly yes/no or true/false
what is an input/output symbol for
inputting and outputting external data
what is annotation symbol for
indicates additional information regarding a step in a process