Algorithm Flashcards
Name 4 algorithm design cycles (4 marks)
Problem analysis: Identify a problem so that a program can be made solve that problem
Algorithm designing: Details about the solution is set out
Coding: Develop the actual program
Testing: Repeat the program with different set of data to debug any bugs
Describe 2 ways for problem analysis (2 marks)
Abstraction: Focus onto the main problem and disregard any unnecessary details
Decomposition: breaking down a large problems into smaller, simple problems
Describes 2 ways for algorithm designing (2 marks)
Flowchart and pseudocode
Describe the uses of all of the following shape in flowchart (4 marks)
Rounded rectangle
Rectangle
Diamond
Parrallelogram
Flow lines
Rounded rectangle: Start/end (terminator)
Rectangle: To describe actions/sequences & assigning variables (not from users)
Diamond: To describe selection & repetititon
Parrallelogram: Input & Output
Flow lines : To show flow of action
Name of types of data (6 marks)
Boolean: True/False
String: Text/ words
Char: a single character
Integers: Numbers
Real: Decimal
Alphanumeric: both integers and string
Components part of computer systems (4 marks)
Input: giving in data
Output: Displaying data
Process: the tasks needed to be performed with the inputted data to display output data.
Storage: data is kept for future use
What is validation (1 mark)
To check if the data entered follow the rules set by the programmer
Examples of validation (6 marks)
Format: To see if the data entered follow a certain structure (@gmail.com)
Type: To see if the data entered match with the type of data
(boolean,string,char,real,alphanumerical or intergers)
Range : To see if the data entered fall within the range
Length: To see if the data entered has enough of characters/ integers
Presence : To see if the data has been entered
Check digit: Value calculated
What is verification? ( 2 marks)
To check if the data entered is what the user intended to type in
To check if the data is copied from a source to another is the one the user intended to input.
Example of verification (2 marks)
Double entry: re-type the same data twice
Visual check: look back at the data to see if they are what you intended to type
How to make an algorithm easier to understand (4 marks)
- Meaningful identifiers
- Adding comments
- Uses of white spaces
- Use of functions
What are the 3 types of test data (3 marks)
Valid data: Data which will be accepted
Extreme data: Data that is the limits of the range that should be accepted (like 1 or 99 in 0<x<100)
Invalid data/abnormal data: Unacceptable data
What are fields and records in database? (2 marks)
Field = Columns
Record = Rows (not including the first section)
What is a primary key? (1 mark)
An unique data to identify other records
What is a subroutine? (1 mark)
A section of the program that is specified to do a specified task