Data types and structures

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/75

flashcard set

Earn XP

Description and Tags

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

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

76 Terms

1
New cards

why are data types important

helps the computer and the user understand the information

2
New cards

what data type is for numbers

integer

3
New cards

what data type is for one letter or one symbol

char

4
New cards

what data type is for mainly words

string

5
New cards

what data type is for decimal

real

6
New cards

what data type is for yes and no or true and false

Boolean

7
New cards

what data type is for a specific date

date

8
New cards

what data type would you for your name

string

9
New cards

what data type would you use for the number of children in a class

integer

10
New cards

what data type would you use for the time taken to run a race

date/time

11
New cards

what data type would you use for whether a door is opened or closed

boolean

12
New cards

what data type would you use for your birthday

date

13
New cards

what is a record

composite date type comprising several related items

14
New cards

what is a random file

file that stores records at specific addresses that can be accessed directly

15
New cards

what is a binary file

where we store records serially or sequentially

16
New cards

what do we use files for

store and read lines of text

17
New cards

what do text files allow you to write

strings in serial or sequential manner

18
New cards

where can you append strings to a file

at the end of the file

19
New cards

what does this do(pseudocode): OPENFILE <filename> FOR WRITE

create a file and open it for writing

20
New cards

what does this do(pseudocode):OPENFILE <filename> FOR APPEND

open a file in append mode

21
New cards

what does this do(pseudocode): OPENFILE <filename> for read

open a file for reading

22
New cards

what does this do(pseudocode): OPENFILE <filename> FOR RANDOM

open a file for random acces

23
New cards

what does this do(pseudocode): CLOSEFILE <filename>

close a file

24
New cards

what does this do(pseudocode): PUTRECORD <filename>, <identifier>

write a record to a file

25
New cards

what does this do(pseudocode): GETRECORD <filename>, <identifier>

read a record from a file

26
New cards

what does this do(pseudocode): SEEK <filename>, <address>

move to a specific disk address within the file

27
New cards

what does this do(pseudocode): EOF(<filename>)

test for end of file

28
New cards

What is going on here?

Dim fileNum As Integer = FreeFile()
FileOpen(fileNum, "filename.txt", OpenMode.Output)

create a file and open for writing

29
New cards

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

30
New cards

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

31
New cards

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

32
New cards

What is going on here?

FileClose(fileNum) 

closing a file

33
New cards

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

34
New cards

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

35
New cards

What is going on here?

Seek(fileNum, address)

moving to a specific position (random access)

36
New cards

What is going on here?

If EOF(fileNum) Then
    Console.WriteLine("End of file reached.")
End If

testing for the end of a file

37
New cards

what does lineinput(filenum) do

reads one line

38
New cards

what is append mode

opening a file so that new data is added to the end of the existing content in the file

39
New cards

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

40
New cards

uses for append mode

saving user input over multiple sessions

41
New cards

what kind of array does random-access file processing use

fixed-length records

42
New cards

why does random-access file processing use fixed-length records

allows computer to directly calculate the position of any record in the file

43
New cards

what does random-access file processing do

store each record in a binary file as the record is created

44
New cards

what can a hashing function calculate

address from the record key and store the record at the calculated address

45
New cards

what does READ do in file handling

read data from the file

46
New cards

what does WRITE do in file handling

writes data to the file

47
New cards

what is the disadvantage of using WRITE when you opened a file

overwrites the data

48
New cards

what is a positive when using APPEND when opening a file

does not overwrite the data

49
New cards

what does APPEND do in file handling

adds data to the end of the file i

50
New cards

is a 1D array a list or table

list

51
New cards

is a 2D array a list or table

table

52
New cards
<p>what is flowchart symbol?</p>

what is flowchart symbol?

flowline

53
New cards
<p>what is flowchart symbol?</p>

what is flowchart symbol?

terminal

54
New cards
<p>what is flowchart symbol?</p>

what is flowchart symbol?

process

55
New cards
<p>what is flowchart symbol?</p>

what is flowchart symbol?

decision

56
New cards
<p>what is flowchart symbol?</p>

what is flowchart symbol?

input/output

57
New cards
<p>what is flowchart symbol?</p>

what is flowchart symbol?

annotations

58
New cards
<p>what is flowchart symbol?</p>

what is flowchart symbol?

predefined process

59
New cards
<p>what is flowchart symbol?</p>

what is flowchart symbol?

on-page connector

60
New cards
<p>what is flowchart symbol?</p>

what is flowchart symbol?

off-page connector

61
New cards
<p>what is flowchart symbol?</p>

what is flowchart symbol?

delay

62
New cards
<p>what is flowchart symbol?</p>

what is flowchart symbol?

alternate process

63
New cards
<p>what is flowchart symbol?</p>

what is flowchart symbol?

data

64
New cards
<p>what is flowchart symbol?</p>

what is flowchart symbol?

document

65
New cards
<p>what is flowchart symbol?</p>

what is flowchart symbol?

multi-document

66
New cards
<p>what is flowchart symbol?</p>

what is flowchart symbol?

preparation

67
New cards
<p>what is flowchart symbol?</p>

what is flowchart symbol?

display

68
New cards
<p>what is flowchart symbol?</p>

what is flowchart symbol?

manual input

69
New cards
<p>what is flowchart symbol?</p>

what is flowchart symbol?

manual operation

70
New cards

what is a flowchart

shapes linked together to represent the sequential steps of an algorithm

71
New cards

what is a flowline for

shows the process’ direction. connects two blocks

72
New cards

what is a terminal symbol for

indicates beginning or end of a flowchart

73
New cards

what is a process symbol for

represent a step

74
New cards

what is a decision symbol for

shows a step that decides the next step in a process. Commonly yes/no or true/false

75
New cards

what is an input/output symbol for

inputting and outputting external data

76
New cards

what is annotation symbol for

indicates additional information regarding a step in a process