Data types and programming techniques Flashcards

1
Q

Data types

A

Integer - whole number
Float - decimal
Character - single letter
String - more than one character
Real - decimal
Boolean - TRUE/FALSE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is concatination

A

connecting of strings or characters next to each other

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is casting

A

Changing the data type of a variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What can you use to find the length of a string

A

len()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a files two modes of operation

A

Read from
Write to

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How can you open a file called scores.txt

A

file = openRead(“scores.txt”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How would you write to a file called scores.txt

A

file = openWrite(“scores.txt”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do you close a file

A

file.close()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How can data be received

A

SELECT
FROM
WHERE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does SELECT do

A

Selects data from the database

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does FROM do

A

Specifies which table to select data from

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does WHERE do

A

Filters a result set to include only records that fulfil a specified condition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is an array

A

A data structure which holds similar, related data.
the data in an array must all be of the same data type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is all data stored under in an array

A

An identifier

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is a row

A

It goes horizontally across

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is a collum

A

It goes vertically down

17
Q

How many rows and collums with arrayscore = [1,9] give me

A

2 rows
10 collums

18
Q

What are the two types of sub programs

A
  • Functions
  • Procedures
19
Q

What is the purpose of a subprogram

A

to perform a specific task

20
Q

What are the benefits of subprograms

A
  • Smaller in size, much easier to write, debug and test
  • Easy for people to understand
  • Saved separately in modules and used again in different codes
  • Can be used repeatedly in a program but the code only has to be written once, reducing code length
21
Q

What is the difference between a function and a procedure

A

A function returns a value

22
Q
A