Topic 2-Programming Flashcards
What is casting?
Technical term for assigning a different data type to a variable.
What is a string?
Sequence of anything.
What is float/real?
Decimal number.
What is a character?
A single character.
What is a boolean?
2 possible states.
What is robust?
Efficient in time, design and no repeating.
What is a variable?
Data values that can change.
What is div?
Integer division.
What is division?
Full division.
What do you need to remember when drawing logic gates?
To draw the input lines.
What is a subroutine?
A set of code that can be called for frequent use within a program.
What is the difference between a function and a procedure?
A function will return something to the main block of code whereas a procedure will not.
What is a function parameter?
The names passed into the function.
What is a function argument?
The value of the parameters.
What do data structures allow?
They allow programmers to store together large amounts of data.
What are some examples of high level/source code programming languages?
Python and Java.
What is machine code?
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.
What is an example of a low level programming language?
Assembly. This is memory efficient but hard for humans to understand.
What is an embedded system?
System with one function.
What is an interpreter?
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.
What is a compiler?
Scans entire code at once and converts it into machine code. This will tell you all the errors.
What are the pros and cons of interpreter’s and compiler’s.
Interpreter is faster to analyse source code but slower at the overall process.
What is an assembler?
Converts low level language to machine code.
What is a logical error?
It is an error in the logic of the code. Doesnt do what it is supposed to do.
What is a syntax error?
Wrong grammar or things like that.
What is a global variable?
A global variable is one which is declared in the main program and is recognised in all the subroutines called from the main program.
What is a local variable?
Local variables are declared within a subroutine.
What are the advantages of using a local variable?
- 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
What is difference between assignment and declaration?
Declaration is declaring a variable, for example mylist=[] whereas assignment is actually assigning a value to it so it could be name=Mark.