Week 1 Flashcards
1
Q
Sebuah algorithm harus:
A
- Jelas, tepat, dan tidak ambigu
- memberikan solusi yang tepat pada semua cases
- Memiliki akhir dari eksekusi pada algoritma tersebut
2
Q
6 Steps in modularisation?
A
- Define the problem
- Group the activities into modules
- Construct a hierarchy chart
- Establish the logic of the mainline of the algorithm, using pseudocode
- Develop the pseudocode for each successive module in the hierarchy chart
- Desk check the solution algorithm
3
Q
7 Step dalam program development?
A
- Define the problem
- Outline the solution
- Develop the outline into an algorithm
- Test the algorithm for correctness
- Code the algorithm into a specific programming language
- Run the program on the computer
- Document and maintain the program
4
Q
The common characteristics of pseudocode?
A
– Statements are written in simple English – Each instructions is written on a separate line – Keywords and indentation are used to signify particular control structures – Each set of instructions is written from top to bottom, with only one entry and one exit – Groups of statements may be formed into modules, and the module given a name
5
Q
Six Basic Computer Operations
A
- A computer can receive information
- A computer can put out information
- A computer can perform arithmetic
- A computer can assign a value to a variable or memory location
- A computer can compare two variables and select one of two alternative actions
- A computer can repeat a group of actions
6
Q
Six Basic Computer Operations
A
- A computer can receive information
- A computer can put out information
- A computer can perform arithmetic
- A computer can assign a value to a variable or memory location
- A computer can compare two variables and select one of two alternative actions
- A computer can repeat a group of actions
7
Q
6 langkah untuk desk checking solution algorithm?
A
- Choose simple input test cases that are valid. Two or three test
cases are usually sufficient - Establish what the expected result should be for each test case
- Make a table on a piece of paper of the relevant variable names within the algorithm
- Walk the first test case through the algorithm, line by line, keeping a step – by – step record of the contents of each variable in the table as the data passes through the logic
- Repeat the walk-through process using the other test data cases, until the algorithm has reached its logical end
- Check that the expected result established in step 2 matches the actual result developed in step 5