Tuesday, October 19, 2010

Algorithms

“Computers never do what you want them to do,

they only do what you tell them to!”



Using the web, find definitions for the following terms and post them on your blog. Make sure the definitions relate to computers and programming.

1. Algorithms
: Step by step instructions required to complete a task

2. Pseudocode: Pseudocode is kind of structured English for describing algorithms. It allows the designer to focus on the logic of the algorithm without being distracted by details of language syntax.
3. Machine Language: Sometimes referred to as machine code or object code, machine language is a collection of binary digits or bits that the computer reads and interprets. Machine language is the only language a computer is capable of understanding.

4. High Level Computer Language
: A programming language that enables a programmer to write programs that is more or less independent of a particular type of computer. Such languages are considered high-level because they are closer to human languages and further from machine languages.

5. Flowchart: It is a type of diagram that represents the algorithm/processes in step by step boxes.

6. Sequence: A boot sequence is the initial set of operations that the computer performs when power is switched on.

7. Selection: Is a type of control stucture when programming and the computer makes a "selection" if the requires criteria is available

8. Repetition: Is a type of control structure in programming where the action is repeated again until a specified time or forever.
Then with the aid of class discussions, write an algorithm for the following processes;

ALGORITHMS

In your algorithm write each step of the process on a new line. Remember not to assume the computer knows anything.

1. opening a door and entering a room.
  1. move 90 degrees to your right,
  2. take 5 medium steps forward,
  3. lift your hand so that it is in level with the door knob,
  4. grab the knob,
  5. turn it 180 degrees, and
  6. push out the door so that it is fully open
  7. end

2. Negotiating traffic lights as you drive down a street.
  1. Approach lights
  2. if you see a green light, continue
  3. if you see a red light, stop
  4. if you see a yellow light, slow down
  5. end


No comments:

Post a Comment