Algorithm Flashcards

1
Q

Name 4 algorithm design cycles (4 marks)

A

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

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

Describe 2 ways for problem analysis (2 marks)

A

Abstraction: Focus onto the main problem and disregard any unnecessary details

Decomposition: breaking down a large problems into smaller, simple problems

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

Describes 2 ways for algorithm designing (2 marks)

A

Flowchart and pseudocode

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

Describe the uses of all of the following shape in flowchart (4 marks)

Rounded rectangle
Rectangle
Diamond
Parrallelogram
Flow lines

A

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

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

Name of types of data (6 marks)

A

Boolean: True/False
String: Text/ words
Char: a single character

Integers: Numbers
Real: Decimal
Alphanumeric: both integers and string

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

Components part of computer systems (4 marks)

A

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

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

What is validation (1 mark)

A

To check if the data entered follow the rules set by the programmer

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

Examples of validation (6 marks)

A

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

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

What is verification? ( 2 marks)

A

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.

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

Example of verification (2 marks)

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How to make an algorithm easier to understand (4 marks)

A
  • Meaningful identifiers
  • Adding comments
  • Uses of white spaces
  • Use of functions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the 3 types of test data (3 marks)

A

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

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

What are fields and records in database? (2 marks)

A

Field = Columns
Record = Rows (not including the first section)

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

What is a primary key? (1 mark)

A

An unique data to identify other records

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

What is a subroutine? (1 mark)

A

A section of the program that is specified to do a specified task

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

What is a function? (3 marks)

A
  • Function is called by its identifers
  • Parameters are passed onto the function
  • It will perform all the required operations and return a value back to the main program

==> function is a subroutine that can return a value

17
Q

What is a procedure? (1 mark)

A

A subroutine that CAN’T return any value back to the main program

18
Q

What is a constant? (1 mark)

A

Stores a value that can’t be changed during the program execution

19
Q

Difference between global & local variables ( 4 marks)

A

Local: Scope is subroutine,procedure or function
Global: Scope is the whole program

Local: Can’t be changed elsewhere in the program
Global: Can be changed anywhere within the program