2.2 Programming Fundamentals Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Define integer

A

Whole numbers. The integer can be positive or negative and include zero.

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

Define real/ float

A

Numbers that have a decimal point. Again – a real number can be negative e.g. -1.8

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

Define Boolean

A

Can only take one of two values: true or false, yes or no, 0 or 1

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

Define character

A

A single letter, number or symbol, e.g. six, Y, &

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

Define string

A

Are used to represent text. It is a collection of characters, e.g. hello

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

Define casting

A

Casting is used to change the date type e.g. you can change the integer 7 to string “7”

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

Define arithmetic operators

A

Arithmetic operators, take two values and perform a mathematical function on them e.g 5 + 6

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

Define exponentiation

A

Exponentiation is used to raise a number to a power. In python the symbols ^ or ** is used

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

Define DIV

A

The DIV operator returns the whole number part of a division. In python the symbol // is used e.g 20 // 3 = 6

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

Define MOD

A

The MOD operator returns the remainder part of the division. In python the symbol % is used, e.g. 20 % 3 = 2

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

Define assignment

A

The assignment operator is used to allocate values to constants or variables.

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

Define comparison operators

A

Comparison operators compare the expression on the left-hand side with the expression on the right hand side, and produce a Boolean value, true or false

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

Define constant

A

A constant is assigned a data value that cannot be changed as the program runs. E.g. VAT = 0.2. This can then be used in calculations cost = price*VAT

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

Define variable

A

The variable is the location of memory that holds one more values. It has a label or name to identify it and its values can be changed as the program runs.

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

Define string manipulation

A

The characters in a string are usually numbered starting at zero. You can use commands which give you information about the string or allows you to alter the string.

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

Define selection statements (IF)

A

If statements allow you to check if a statement is true or false and then carry out different actions depending on the outcome.

17
Q

Define selection statements (SWITCH)

A

Switch statements (also known as case select statements) can check if a variable has a specific value.

18
Q

Define count controlled loop (FOR)

A

For loops will repeat the code in them a fixed number of times.

19
Q

Define condition controlled loop (WHILE)

A

While loops are controlled by condition at the start of the loop. They will keep going while the condition is true.

20
Q

Define condition controlled loop (DO)

A

I do… Until loop is controlled by a condition at the end of the loop. It will keep going until the condition is true. This loop will always run the loop at least once

21
Q

Define Boolean operators

A

You need to know three Boolean operators: AND, OR, NOT.

These are used in selection and iteration statements.

22
Q

Define random numbers

A

Most programming languages have a function to generate random numbers. These are useful for simple games.

23
Q

Define arrays

A

An array is a data structure that can store a collection of data values all under one name. Each value is called an element.

24
Q

Define two dimensional arrays

A

Two dimensional arrays can be thought of as a one-dimensional array where each element is a one-dimensional array.

25
Q

Define file handling

A

File handling is all about how the program can access data and change data that is stored in an external file.

26
Q

Define records

A

A record is a type of data structure like an array – it is used to store a collection of data values. They can store values with different data types.

27
Q

Define SQL

A

Structured query language can be used to search database tables for specific data.

28
Q

Define sub programs

A

Sub programs can be used to save time and simplify code. The sub program will usually carry out a specific task.

29
Q

Define procedures

A

Procedures is a set of instructions, stored under one name. When you want your program to carry out these instructions, you just call the name of the procedure.

30
Q

Define functions

A

Functions are similar to procedures but functions always return a value.

31
Q

Define concatenation

A

Joining strings together

32
Q

What are th three programming fundamentals?

A

Sequence, selection, iteration

33
Q

Does an array store a fixed number of data elements?

A

Yes

34
Q

How do you insert into an array?

A

ScoobyGang[3] = “Laura”

35
Q

How do you delete a value in an array?

A

List.pop[3]

36
Q

What is the order of a 2D array?

A

Row, column

37
Q

What is a record?

A

Like an array but can store different data types

38
Q

What is SQL?

A

Structured Query Language
SELEECT
FROM
WHERE

39
Q

What does SELECT * mean?

A

Select all fields