2.1 Flashcards

1
Q

what are local varibles?

A

variables which are declared withina specific subroutine and can only be used within that subrotoutine

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

what are global variables?

A

variables that can be used anywhere in the whole of the programm

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

what are local variable advantages?

A
  • saves memeory- only uses memory when varibale is needed
  • easier to debug
  • you can reuse subrotines with local variables
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what are the global variable advantages?

A
  • variables can be used anywhere in the whole programm
  • makes maintenance easier
  • can be used for constants (values that remain the same)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what is a disadvatage of global variable

A
  • global variables use memory whether they are used or not

kinds wastes the memory then

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

what is MOD and what is DIV

A

DIV is the whole number(//)
MOD is the remainder (%)

15//2 = 7 15%2=5 15/2 =7.5

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

what is input sanitisation?

A

Checking and cleaning up data

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

what is anticipating Misuse?

A

Planning ahead to take steps against potential misuse

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

Maintainable code?

A

Allowing other programmers to easily read and quickly understand code

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

what is validation

A

Checking whether input data follows specific criteria and should be accepted

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

what is Verification

A

Checking whether data that has been entered is correct

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

what is Authentication

A

Ensuring only authorised users can gain access to a system

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

what is used in defensive designing?

A
  • validation
  • verification
  • authentication
  • input sanitization
  • anticipating missues
  • maintainable code
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

what is used in validation?

A
  • range check
  • type check
  • length check
  • presence check
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

what is maintainability?

this is maintable code basically

A
  • appropriate varibale name- to make sure the prupose of varibale is understood.
  • comments- so progammer can udertsand purpose of each line of code.
  • indentation- to improve readability and clearly show each ‘block’ of code.
  • constants- This keeps the program code consistent, which makes it easier to read and debug a program.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

what is a sytax error

A
  • a mistake in the grammatical rules
  • will prevent programm from being executed

example prant(“hello) missing commas and speeled print wrong

17
Q

what is a logical error?

A
  • mistake made by the programmer
  • the programm will still run
  • this will display the wrong output.
18
Q

what is boundary data

A

Data at the extreme boundary of any data ranges

19
Q

what is normal data

A

sensible data that the program should accept and be able to process.

20
Q

inavlid data

A

Data of the correct data type that does not meet the validation rules (e.g. outside of the range). It should not be accepted.

21
Q

what is erroneous data

A
  • Data of the wrong data type that the program cannot process and should not accept.
22
Q

what is high level langauge?

A
  • similar to a natural human language
  • easier to understand and use
  • leads to fewer errors
  • must be translated into machine code and cannot be directly executed by the cpu
23
Q

what is low level language?

A

do not closely resemble a natural human language, making it harder for humans to understand and write

24
Q

machine code is a type of low level language what does it do?

A
  • binary code that computers can directly process and execute.
  • executed faster than high-level programs
  • perform a very specific command
25
assembly language is a type of low level langauge what does it do?
* uses specialised command to perfrom actions * easier to understand and spot errors. * faster to execute than high-level languages and, like machine code, can be used to directly control the CPU.
26
what does an interperator do?
* translates source code (high level code) into machine code one line at a time. * slower than a compiler because the code must be reinterpreted each time the program is run. * report errors to the user immediately and stops the program from running.​
27
what does a complier do?
* all the source code (high level code) into machine code in one go. * faster execution speed due to more efficient code prodcued * The compiler would analyse the entire program, taking note of where errors are and record them in an error file.
28
what are some IDE tools?
* interpreters and compilers * error diagnostics * editor
29
what does an editor do?
* automatic formatting * auntomatic colour coding * automatic line numbering
30
what does runtime enviroment?
* checks for runtime errors and allows user to test the programm
31
what does interpreter do?
convert source code to machine code to be executed by the cpu