2.2 Programming Fundamentals Flashcards

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

What is a variable?

A

A value that can change whilst the program is running. It is simply an address in memory e.g. an integer, character string, real(float) or Boolean.

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

What is a constant?

A

A value which remains fixed as it does not change while the program is running, and is assigned when the program is running.

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

What is an assignment?

A

When we give, or supply a value to a variable or constant. It is performed with the ‘=’ symbol.

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

What is an operator?

A

Symbols used to perform operations on variables and values

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

What is an output?

A

Data generated by the computer and displayed to the user.

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

What is an input?

A

A value is read from an input device e.g. Keyboard

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

What is casting?

A

Converting a variable from one data type to another e.g. integer to a string

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

Advantages of constants:

A
  • Easier to read as they are usually declared and assigned at top of the program
  • Less chance of errors
  • Makes program run more quickly if used instead of variables
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Why is casting needed?

A
  • Inputs from keyboards are always characters. Multiple characters are called a string
  • Integers require less bits of memory than numbers with a decimal part (real numbers)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Data types for constants and variables

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

Three Programming Constructs

A

Sequence, Selection, Iteration.

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

What is sequence?

A

Executing one instruction after another

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

What is selection?

A

Selection is a program branching depending on a condition (if, else, elseif)

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

What is branching?

A

A construct that allows the program to end up going in a number of various directions depending on the outcome of a condition

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

What is iteration?

A

Iteration, sometimes called looping, is repeating sections of code until a condition is met. (for loop, while loops)

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

What are while loops?

A

While loops, known as condition controlled loops are used when the number of iterations is not known because the variable used to determine when the iteration end is changing within the iteration itself.

17
Q

What are DO..UNTIL loops?

A

An alternative to WHILE where the code is executed at least once before the condition is checked

18
Q

What does the Arithmetic Logic Unit perform?

A

Arithmetic comparisons, logical comparisons, binary shifts

19
Q

Why is a Boolean operator called Boolean Expression?

A

The expression equates or evaluates to either true or false

20
Q

What does concatenate mean ?

A

Join together

21
Q

How do we concatenate numbers?

A

In order to concatenate them, and not simply add them they need to be stored as a string data type

22
Q

How can you perform arithmetic operations on values?

A

Converts string data types back into integers or any other data types to perform arithmetic operations on values

23
Q

What is a value entered from the keyboard inputted as?

A

Characters

24
Q

Why is casting necessary?

A

It is so subproblems receive data in a format they are expecting

25
Q

What does casting allow?

A
  • numbers to be manipulated as strings
  • inputs that are strings to become numbers
26
Q

What is an array?

A

A variable which contains more than one data item e.g. storing a list of names

27
Q

What does contiguous mean?

A

All the data is stored together, one element after another

28
Q

What does index start with?

A

It starts with 0

29
Q

What is append?

A

Asserting a new item into new location at end of array using an index

30
Q

How is the element (particular data item) found?

A

Using the index

31
Q

Are arrays single and multiple dimensions?

A

They are both

32
Q

What is a flowchart?

A

A method of representing sequences of steps in an algorithm in form of a diagram

33
Q

What is pseuodocode?

A

Alternative text-based way of representing sequence of steps in an algorithm

34
Q

Advantages of using sub programs

A

Easier to write/read and debug and creates reusable components

35
Q

What are sub-routines?

A

Larger programs developed as a set of sub-programs

36
Q

What do functions do?

A

Return values and create reusable program components

37
Q

What do procedures do?

A

Create a modular structure to a program making it easier to read

38
Q
A