Part 2, Numbers Strings and Lists Flashcards

1
Q

what is a “prototype program”

A

this is a set of smaller programs which may become part of a larger program

or a program created to get an early idea of how a program may look

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

what is a “constant”

A

a constant is a variable which will not change its value during the execution of the program

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

what is meant by “self documenting” code

A

this is code that almost documents itself it means it is easily readable and self explanatory for anyone reading it

appropriately named variables and modules is such an example of self documenting code

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

what is meant by the term “hard coded”

A

this is a term to describe a value that appears in the code and will not change

unlike constants it will have no name and so is sometimes referred to as “magic numbers” because they make the code work but why is unclear and how it relates to the rest of the program is unclear

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

instead of hard coding a value what would be a more suitable solution that maintains readability

A

creating a constant for the value would be a more suitable solution instead of hard coding

this means all occurrences of the value are easily changed and the code is “self documenting”/more readable

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

what is “incremental construction”

A

this is the idea of constructing a value or variable step by step

example:
if we had to display a sentence to the user which contained variables we might construct a display_text variable adding parts of the sentence piece by piece
once built we display the display_text to the user

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

what does “running step-by-step” mean

A

this involves breaking a script apart and running each block one by one. then watching how each block operates within the program

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

what are four benefits of “running step-by-step”

A
  1. understand what a script does
  2. understand how variables change
  3. understand someone else’s work
  4. debugging
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

what is a “list”

A

a list is a collection of data stored together as one

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

name two properties that lists have

A
  1. lists can shrink and grow dynamically

2. lists can store numbers, strings and more

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

what are “data structures”

A

a data structure is how a programming language stores and handles data

this might include any relationships the data has or what actions may be performed on that data

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

what is “persistent data”

A

persistent data is data that is held unless explicitly deleted

an example could be data in a variable which would still remain after each running of a program unless explicitly deleted

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

what is a “specification”

A

a specification is description of a program giving details of what it should do

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

what is an algorithm

A

an algorithm is a step by step description of your program

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

creating an algorithm can be split into two distinct steps

what are they

A
  1. design

2. implementation

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

describe how an algorithm is designed

A

an algorithm is designed from the given specification
each step of the program should be written in detail outlining exactly how you will produce each outcome

example:
if maths is involved in the program you would describe the calculations you will be using in the algorithm

17
Q

describe how an algorithm is implemented

A

implementing an algorithm involves following each step of the algorithm and translating it into code

18
Q

what are two main reasons for creating an algorithm

A
  1. creating an algorithm can help simplify some of the complexities early on
  2. when a team is involved communication can be performed via the algorithm
19
Q

name two reasons an algorithm is useful within a team environment

A
  1. different parts of the algorithm can be distributed to members of the team to work on so the program can be built faster
  2. any problems that arise while building the program can be pointed to in the algorithm giving everyone good understanding of where or why the problem exists
20
Q

what is “acceptance testing”

A

this is a process carried out with commercial software products.

it is a set of possibly thousands of tests which are used to reassure the customer that the software behaves as it should according to its specification