- Problem Solving Phase
- Program Implementation Phase
As a beginning programmer, you must understand that the key to writing efficient programs is to master the problem solving phase.
PROBLEM SOLVING PHASE
- Define the problem
- Find a solution
- Evaluate alternate solutions
- Choose the most efficient solution and write an algorithm
- Test the algorithm for correctness
To define the problem, a defining diagram is used. The defining diagram is also known as an IPO table. It is a three column table that separates the problem into INPUT, PROCESSING, and OUTPUT.
ALGORITHM
An algorithm is a series of instructions that rigorously defines the solution to a problem.
Forms of algorithms:
- Narrative algorithms - written in plain English text
- Pseudocode algorithms - written in English-like text (code) and English
- Flowchart - pictorial representation of an algorithm
- Structured algorithms - written in code; the only executable format of an algorithm
Types of algorithms:
- Simple algorithms
- Conditional algorithms
- Loops
- Arrays
Example of a simple algorithm:
Print "Hello Student"
Print "Hope you're reviewing for your upcoming test"
Print "Kindly enter your name"
Input sname$
Print sname$,"Good luck on your test"
Input key
Having trouble remembering simple algorithms? Start a discussion in edmodo and ask your peers for help.
No comments:
Post a Comment