Algorithm Design

  • June 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Algorithm Design as PDF for free.

More details

  • Words: 211
  • Pages: 4
Algorithm A algorithm is a stepDesign by step instruction that must have a set of rules that must have a explicit STOP POINT! Pseudo code is colloquial English-like terms used to specify a task A pseudocode should begin with the keyword PROGRAM and end it the keyword END. IPO chart algorithm read three numbers number3

Pseudocode READ number1, number2,

add three numbers together

total = number1,

• Related line of code form a statement. • Instructions within the statement are called keywords. • Variables: these store data for the program to work within. local, global, or constant. • Conditional statement: provide a choice of “if /then/else”

• Loops allow parts of a program to be repeated. Example “ do/while” “for /next”, or “repeat/until”. A statement is a description of an action or condition. Keywords such as READ, WRITE, DO, WHILE, FOR, NEXT, PRINT

Conditional statements allow decision in a program to be made. IF/ THEN: IF ( some condition is true) THEN Example: READ number1, number2, number3 total = number1, number2, number3 IF total > 50 THEN If PRINT total ( mon ey>1 True 49) IF (condition) Buy Soda

THEN statement END IF

One Option False

IF/ THEN/ ELSE: IF/ THEN: IF ( some condition is true) THEN ELSE (otherwise) Example:

Related Documents

Algorithm Design
June 2020 6
Algorithm
October 2019 95
Algorithm
November 2019 83
Algorithm
May 2020 56
Algorithm
November 2019 82