8 Programming Flashcards

1
Q

Where can data be stored in a program?

A

variables and constants

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

What is a variable?

A

A named memory location that can store data. The data can change whilst a program is running

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

What is a constant?

A

A named memory location that can store data. The data cannot change whilst a program is running

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

What is an identifier?

A

A name given to a variable, constant, data structure (eg: array) or subroutine

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

What is assignment?

A

A type of programming statement that stores data in a variable or constant

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

What is a data type?

A

The characteristics of a piece of data

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

What are common data types?

A

String, integer, real / single / double (same), boolean, char

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

What is casting?

A

Converting data from one data type to another data type

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

What is output?

A

Data that is displayed to the user, usually on-screen

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

What is concatenation?

A

Joining two or more strings together

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

What is input?

A

The user entering data into the program, usually from a keyboard

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

What is an arithmetic operator?

A

A symbol that performs a mathematical function (eg: +, -)

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

What are the most common arithmetic operators?

A

+, -, *, /, DIV, MOD, ^

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

What does the arithmetic operator DIV do?

A

DIV gives the whole number after the first number is divided by the second, it ignores any decimals

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

What does the arithmetic operator MOD do?

A

MOD gives the remainder after the first number is divided by the second

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

What are parenthesis?

A

Brackets in a mathematical statement. They determine which calculations are performed first

17
Q

What is a sequence?

A

A programming construct. Instructions are run once and in the order they are written

18
Q

What is selection?

A

A programming construct. A condition is checked and this determines which code is run, or not run

19
Q

What is an IF statement?

A

A type of selection construct where the result of the condition is either true or false

20
Q

What is a CASE statement?

A

A type of selection construct where there is a list of different values to compare a single value against

21
Q

What does a condition need and why?

A

Conditions need logical operators as these allow for comparisons to be made

22
Q

What is a logical operator?

A

A symbol that performs a comparison resulting in True or False.

23
Q

What are examples of logical operators?

A

equals( = or ==), not equal to (<> or !=), less than (<), less than or equal to (<=), greater than (>), greater than or equal to (>=)

24
Q

What is iteration (or a loop)?

A

A programming construct. Code is run multiple times - either a finite number of times (count-controlled), until a condition is true (post-condition) or while a condition is true (pre-condition)

25
What is a count-controlled loop?
A type of iteration where code is run a finite number of times, usually for a loop
26
What is a pre-condition loop?
A type of iteration. Code is run while the condition is true. The condition is checked before running any code in the loop
27
What is a post-condition loop?
A type of iteration. Code is run until a condition is true. The condition is checked after the code in the loop is run
28
What is an important difference between pre-condition and post-condition loops in terms of whether or not the code runs?
In pre-condition loops, the code might never run; in post-condition loops, the code always runs once