Topic 2-Programming Flashcards

1
Q

What is casting?

A

Technical term for assigning a different data type to a variable.

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

What is a string?

A

Sequence of anything.

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

What is float/real?

A

Decimal number.

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

What is a character?

A

A single character.

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

What is a boolean?

A

2 possible states.

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

What is robust?

A

Efficient in time, design and no repeating.

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

What is a variable?

A

Data values that can change.

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

What is div?

A

Integer division.

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

What is division?

A

Full division.

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

What do you need to remember when drawing logic gates?

A

To draw the input lines.

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

What is a subroutine?

A

A set of code that can be called for frequent use within a program.

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

What is the difference between a function and a procedure?

A

A function will return something to the main block of code whereas a procedure will not.

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

What is a function parameter?

A

The names passed into the function.

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

What is a function argument?

A

The value of the parameters.

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

What do data structures allow?

A

They allow programmers to store together large amounts of data.

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

What are some examples of high level/source code programming languages?

A

Python and Java.

17
Q

What is machine code?

A

Everything is turned to binary so it is the most efficient and only runs on 1 processor. However it is almost impossible for humans to understand.

18
Q

What is an example of a low level programming language?

A

Assembly. This is memory efficient but hard for humans to understand.

19
Q

What is an embedded system?

A

System with one function.

20
Q

What is an interpreter?

A

Translates code to machine code one statement at a time. This will tell you where the first error is which makes it easier to debug.

21
Q

What is a compiler?

A

Scans entire code at once and converts it into machine code. This will tell you all the errors.

22
Q

What are the pros and cons of interpreter’s and compiler’s.

A

Interpreter is faster to analyse source code but slower at the overall process.

23
Q

What is an assembler?

A

Converts low level language to machine code.

24
Q

What is a logical error?

A

It is an error in the logic of the code. Doesnt do what it is supposed to do.

25
Q

What is a syntax error?

A

Wrong grammar or things like that.

26
Q

What is a global variable?

A

A global variable is one which is declared in the main program and is recognised in all the subroutines called from the main program.

27
Q

What is a local variable?

A

Local variables are declared within a subroutine.

28
Q

What are the advantages of using a local variable?

A
  • keeps the subroutine self-contained
  • program will be easier to debug and maintain
  • local variables save memory as the space used by local variables is freed up when the subroutine completes
29
Q

What is difference between assignment and declaration?

A

Declaration is declaring a variable, for example mylist=[] whereas assignment is actually assigning a value to it so it could be name=Mark.