PAPER 2 - Algorithms, Programming, Logic Flashcards
What is analysis
- abstraction, decomposition of the problem, identification of the problem
What are the 4 main stages in the program development life cycle:
-ANALYSIS
- DESIGN
- CODING
- TESTING
What is design
- decomposition, structure diagrams, flow charts, pseudocode
What is coding
Writing program code + iterative testing
what is testing
Testing program code with use of test data
What is abstraction
- involves identifying the key parts of the problem
-
removing any unnecessary detail to make it easier to
solve
What is the purpose of structure diagrams
- show structure of the problem, its subsections + links to other subsections
What is decomposition
The breaking down of a complex problem into smaller, manageable parts which are easier to solve
What are the 4 steps of decomposition
- identify the main problem
- identify the component part of input, processes, outputs and storage
- list main sub-problems, sub-systems , functions or tasks
- break these down into smaller sub- problems or sub-tasks , which can be completed separately
In flow charts what is the symbol for input/output
Parallelogram
Flow chart symbol for process
Rectangle
Flow chart symbol for decision
Diamond
Flow chart symbol for terminator
Oval
What are the 5 data types
- integer
- real/float
- Boolean
- char
- string
What is a real/float
number with a decimal point
What is a Boolean
Either TRUE or FALSE
What is a char
A single alphabetic or numeric character
E.g. A,#, @, 6, !
What is a string
A sequence of one or more characterS
E.g. “yes”, “Hi John”
Explain the difference between a variable and a constant.
- Variable – a storage container in memory that can hold information as a number, a person’s name or a whole sentence.
-
Constant – a variable, once defined , it cannot be changed during execution of program, You cannot declare a value as a constant in python.
E.g. Value that never, or rarely changed : pi, speed of light
Pi = 3.142
Radius = float(input(“Enter radius”)
Circle_area = pi*(radius^2)
Print(Circle_area)
What is a variable and what is a constant
Variable = radius
Constant = Pi
What is the assign symbol operator un psuedocode
<—
WHILE….__
DO
A <— 22 MOD 5
What is A?
2 (reminder)
C <— 22 DIV 5
C = 4