Programming Flashcards

1
Q

What is a variable?

A

A named space in memory large enough to store a single data type

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

What is a constant?

A

A named space in memory with a value that never changes while the program is running

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

What are the 5 data types?

A

Boolean
Character (not in python)
Integer
Real
String

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

What is declaration?

A

Code that causes a variable to exist

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

What is assignment?

A

The process of putting a value into a variable

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

What is the difference between definite and indefinite iteration?

A

Indefinite iteration is iteration using while loops and so carries on idefinitely till the conditional statement

Definite iteration is iteration using for loops and so is used a set number of times initially specified

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

What are operations? What are the 3 types?

A

Operations are an action performed on one or more pieces of data in order to produce additional data

Arithmetic (+, -, *, /)
Relational (<, >, ==, !=)
Logical (and, or, not)

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

What are the two types of data structures and their differences?

A

One-dimensional arrays store same data types with each element referenced by an index number

Two-dimensional arrays store same data types in a grid referenced by row then column

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

What is a record?

A

A data structure that can accept multiple data items of different types. A row in a database

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

What is an input and output?

A

Input is the process of introducing data to a system
Output is the process of communicating data beyond the system

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

What is a file?

A

A store of data that continues to exist when the program or computer is no longer running

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

What are the 6 string handling operations?

A

Concactenation
Length
Index
Substring
Convert
Conversion

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

What does ord() and chr() do?

A

Ord() converts a character to ASCII
Char() converts an ASCII code to a character

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

What is a subroutine?

A

A small subsection of the whole program that performs a specific task.

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

What are the benefits of a subroutine?

A

Each subroutine can be give to a different programmer inviting teamwork
Subroutines can be separately tested without waiting for the whole program to finish
Subroutines that are commonly used can be reused

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

What is a parameter and calling?

A

A piece of data that is passed into a subroutine in order for the subroutine to do its job.
Calling is a process where an instruction tells another named part of the code to run

17
Q

What is the return command in a function?

A

A command in which a subroutine passes a piece of data back to the line of code from which it was called

18
Q

What is modularisation?

A

The process of breaking a program into smaller parts called modules

19
Q

What is a robust program?

A

A robust program continues to function even when confronted with unexpected events, such as a lost network connection or user inputting data the wrong data type

20
Q

What is secure programming?

A

A secure program prevents users from accessing or altering data that they should not access or alter. Usernames and passwords make up one approach for keeping a program secure

21
Q

What is a validation algorithm?

A

Ensuring that data entered into the computer is reasonable and sensible.

22
Q

What is a range check?

A

Ensuring that data entered is within a specific numerical value range

23
Q

What is a type check?

A

Ensures that the correct data type has been entered

24
Q

What is a length check?

A

Ensures that a string contains a valid number of characters

25
Q

What is a lookup check?

A

Checks that what the user has entered exists on a list

26
Q

What is a presence check?

A

Simply checks that the user has entered something

27
Q

What is authentication?

A

The software process ensuring that the person accessing a system is the person who is supposed to access that system

28
Q

What is normal test data?

A

Data that is valid and that represents how the program would be used

29
Q

What is boundary test data?

A

Data that is just barely valid to check that the extreme ranges of normal input work correctly. Sometimes its good practice to test data that is just outside the acceptable range

30
Q

What is erroneous data?

A

Data that should not be accepted by the system. This is included to test to see whether a programs validation and error messages work correctly

31
Q

What is a high level programming language?

A

High-level languages are more understandable so high-level languages are far more popular

32
Q

What is a translator?

A

A program that translates source code into machine code

33
Q

What are the 3 types of translators?

A

Assemblers translate assembly language
Interpreters translate high level code one line at a time
Compilers translate an entire high level program at once before executing

34
Q

What are the advantages and disadvantages of an interpreter?

A

+ A program that contains errors can still be run till the error
+ Debugging is easier
- Every time it is run it needs to be interpreted
- Easier for unauthorised people to access source code

35
Q

What are the advantages and disadvantages of a compiler?

A

+ A compiled code will run quicker than reinterpreted code
+ It is more difficult for unauthorised people to access
- More memory used in compilation
- Entire program needs to be error free before