Programming Concepts Flashcards

1
Q

What is the difference between data and information?

A

Computers understand data whereas humans understand information. Computers have to convert information into data in order to process it.

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

What is a constant?

A

A constant is a value that can’t be changed while the program runs

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

What is a variable?

A

A variable is a value that can be changed by the program as it runs

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

Why is it important that variables have data types?

A

Because using the correct data type helps to avoid errors. For example, if a program incorrectly stored numbers using the data type ‘string’, and then attempted to carry out mathematical operations on the is data, it would prove impossible because text data cannot be manipulated in this way.

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

What are the advantages of using Boolean?

A
  • Faster entry of data
  • Less memory used
  • Lower the chances of errors
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a multi-dimensional array?

A

An array that can store more than one series of data in conjunction

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

What are the three common relational Boolean operators?

A

AND
OR
NOT

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

What does each operator mean?
A. =
F. >

A
A. Less than
B. Less than or equal to
C. Equal to
D. Not equal to
E. Greater than or equal to
F. Greater than
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a procedure?

A

A set of instructions that form a specific task as part of a larger program

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

What is the difference between a procedure and a function?

A

A procedure simply executes it’s statements and then returns control to the main program whereas a function also receives and sends values between the program and itself

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

Name and describe three built in functions in a language of your choice.

A

(C++)
Round- this rounds numbers up/down eg, Round(111.5) returns 112

Abs- this will return the number as a positive eg, Abs(-112) will return 112

Sqrt- this will return the square root of the number eg, sqrt(12544) will return 112

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

What is a parameter?

A

A value that is sent to a procedure or a function

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

What is a return value?

A

The data which functions send beck to the main program when they have finished their execution

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

Define scope

A

The range over a program in which a variable, constant, function or procedure can act

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

Give two types of functions with different scope

A

Public/global- can be called from anywhere in the program

Private/local- can only be called from an individual area of the program

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

What is an algorithm?

A

A series of steps or instructions that are followed in order to solve a problem

17
Q

What is pseudo code?

A

Structured English that describes and algorithm, similar to the real code

18
Q

Describe a sequence

A

When a set of instructions is executed in order

19
Q

Describe a selection

A

When an option of statements is provided and a condition is used to decide which option was chosen

20
Q

Describe an iteration

A

When a group of statements are repeated until a condition is met

21
Q

What is a nested construct?

A

Using one programming construct within another eg, using a selection within and iteration

22
Q

Describe what is meant by top down design

A

Solving problems by breaking them down into smaller problems.