Unit 11 Programming Techniques Flashcards

1
Q

What is an IDE?

A

Integrated Development Environment
A software which enables you to enter, edit, compile, interpret and run your programs

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

How can an IDE make entering program code as easy and quick as possible? (4)

A
  • Add line numbers
  • Automatically indent code
  • Auto-complete commands
  • Comment or un-comment a region
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is an Algorithm?

A

A sequence of instructions that can be followed to solve a problem

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

What is Pseudocode?

A

A type of instructions that are somewhere between English and a programming language

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

What is an Identifier?

A

A name that points to memory location

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

What is Assignment?

A

Assigning a value to the memory location

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

What is the difference between a Variable and a Constant?

A

A variable can be changed a constant can’t

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

Why would someone use a Constant instead of a Variable?

A

Reduces the risk of errors by reducing access to the memory location

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

What does MOD do?

A

Outputs the remainder after dividing 2 numbers

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

What does DIV do?

A

Outputs the integer answer after dividing 2 numbers

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

What does a Boolean Condition evaluate to?

A

True or Flase

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

What does AND do?

A

Returns TRUE if both conditions are true

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

What does OR do?

A

Returns TRUE if either of the conditions is true

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

What does NOT do?

A

A TRUE expression becomes FALSE and vice versa

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

What is Iteration?

A

Repetition of sections of code. There are 3 types of loop: While, Do and For

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

What is a Subroutine?

A

A set of instructions with a name. Program flow will ‘jump’ to that subroutine when called. When the subroutine has finished, the program will continue from where it was called

17
Q

What is a Library Subroutine?

A

A subroutine that comes pre-defined with the programming language

18
Q

How do you pass data to a Subroutine?

A

Put arguments in parentheses after calling the subroutine

19
Q

Why is the order of the parameters in the parentheses in the Subroutine important?

A

Each parameter order corresponds to a different variable in the subroutine

20
Q

How can a Function return a value?

A

Using a return statement

21
Q

What’s the difference between a Local and Global Variable?

A

A local variable is contained in a subroutine and can only be used, referenced or changed in that subroutine. A global variable is defined in the main program and can be used in any subroutine called from the main program

22
Q

What are the advantages of a Local Variable? (2)

A
  • The subroutines will be independent of a particular program and can be re-used in different programs
  • There is no chance of accidentally changing a variable in the main program that is used in a subroutine or vice versa
23
Q

What is Modular Programming?

A

Where a major task is broken down into smaller subtasks that may be further broken down until each ‘module’ performs a single function

24
Q

What are the advantages of Modular Programming? (4)

A
  • Large programs are broken down into subtasks that are easier to program and manage
  • Each module can be individually tested
  • Modules can be re-used several times in a program
  • Large programs are much easier to debug and maintain
25
What are the essential characteristics of a Recursive Routine? (3)
- A stopping condition or base case must be included - For input values other than the stopping condition, the routine must call itself - The stopping condition must be reached after a finite number of calls
26
What is the Fibonacci Sequence?
Where each number is found by adding the two preceding numbers
27
In OOP what does a class do?
Defines what an object in the class will look like (its properties), and what it can do (its methods). Its the blueprint for an object
28
In OOP what is an Attribute?
A property of an object
29
In OOP what is a Method?
The procedures that an object can perform
30
Are Attributes normally defined as public or private?
Private
31
Are Methods normally declared as public or private?
Public
32
What does Encapsulation do?
Wraps the attributes and methods in the class definition, hiding details of the implementation from the user
33
What is a Constructor?
A method used to create a new object in a class
34
What is Instantiation?
Creating an instance of an object
35
What is Polymorphism?
The ability of a programming language to process objects differently depending on their class
36
What are the advantages of OOP? (4)
- Classes can easily be saved in a library and reused in other programs - Encapsulation reduces code complexity - Attributes can be hidden from users so that they cannot change them accidentally - Easier to modify and maintain