3.2 Programming Flashcards

1
Q

Data types

A

Programming languages store data as different types and they are dealt with differently by the program.

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

INT

A

Integer - whole numbers, positive and negative

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

REAL

A

Numbers that have a decimal point- sometimes called FLOAT

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

BOOLEAN

A

Can have one of two values - true/false, yes/no, 1/0

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

CHAR

A

Character - a single letter, number or symbol

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

STRING

A

Used to represent text - it is a collection of characters

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

Casting

A

Changing one data type to another, e.g. converting string to integer

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

DIV operator

A

Returns the whole number part of a division, e.g. 5 DIV 2 = 2

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

MOD operator

A

Returns the remainder part of a division, e.g. 5 MOD 2 = 1

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

Assignment

A

Assigning a value to a variable or constant, e.g. total=25 assigns the value 25 to the variable total

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

Comparison operator

A

Compares the left hand side of an expression to the right hand side, e.g. 4<10 (is 4 less than 10)

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

Same as?

A

Python uses ==

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

Not the same as?

A

Python uses !=

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

Variable

A

A named data store which can change as the program is run

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

Constant

A

A named data store which cannot be changed as the program is run, e.g. pi

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

Local variable

A

A variable that is only defined and usable in certain parts of a program

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

Global variable

A

A variable that can be used throughout the whole program

18
Q

Selection

A

A decision/way of controlling a program using a selection statement, IF - THEN - ELSE

19
Q

Nested IF statements

A

Using an IF statement inside another one.

20
Q

ELIF

A

Used where there is more than one option in a selection statement. Short for ELSE - IF

21
Q

Iteration

A

A way of repeating a set of instructions - can be a based on a condition or a number of repetitions

22
Q

FOR LOOP

A

A count controlled loop

23
Q

Array

A

A data structure that can store a group of data values of the same time. A one-dimensional array could be called a LIST. A two-dimensional list could be called a TABLE.

24
Q

Subroutine

A

A set of instructions stored under one name which can be used (called) when you want the program to use them

25
Q

Functions

A

Subroutines that return a value

26
Q

Procedures

A

Subroutines which do not return a value

27
Q

Structured programming

A

Breaking down a complex problem into more manageable sub-problems and using subroutines for these.

28
Q

Robust programming

A

This protects against unexpected inputs or actions, ensures that users are allowed to enter data and tests for bugs/problems

29
Q

Authentication

A

Used to confirm the identity of the user and includes passwords

30
Q

Validation

A

revents the accidental or intentional misuse of a program when entering data, e.g. the use of range, presence, format checks, lookup tables and length checks

31
Q

Testing

A

Allows the writer of the program to check for syntax and logic errors

32
Q

Algorithm efficiency

A

Different algorithms can perform the same taks. The efficiency is less about the lines of code and more about, for example, the number of times a loop was executed or memory accessed.

33
Q

Trace tables

A

Allows you to test that a piece of code is working correctly by tracking the values that certain variables take as you go through the code.

34
Q

High level computer language

A

Easy for humans to write, e.g. Python

35
Q

Low level computer language

A

Easy for computers to run, e.g. machine code and assembly language

36
Q

Translators

A

Necessary to translate high level languages into machine code. There are 3 types of translator - assemblers, compilers and interpreters

37
Q

Machine code

A

The lowest level language consisting of 1s and 0s

38
Q

Compilers

A

Translate all the code at the same time. Can take a long time to compile but once compiled runs the program quickly

39
Q

Interpreters

A

Translates and runs the source code one line at a time. This has to be done every time you run the program and runs more slowly

40
Q

Assemblers

A

Turns assemby language into machine code - each language needs its only unique assembler