Wednesday, September 3, 2014

Intro to Programming Review: The problem solving phase

In computer program development, there are two phases:

  1. Problem Solving Phase
  2. 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
  1. Define the problem
  2. Find a solution
  3. Evaluate alternate solutions
  4. Choose the most efficient solution and write an algorithm
  5. 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