Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Algorithms Vs Meta Language


Published on

Published in: Education, Technology
  • Be the first to comment

Algorithms Vs Meta Language

  1. 1. Algorithms vs Syntax Structure Diagrams<br />Kelly Bauer<br />
  2. 2. Algorithms Sequence: <br /> BEGIN<br />Process 1<br />Process 2<br />Process 3<br />END<br />
  3. 3. Selection: Binary <br />
  4. 4. Selection: Multiple<br />
  5. 5. Repition: Pretest<br />
  6. 6. Repition: Post test<br />
  7. 7. Subprograms<br />All of these examples are published by the BOS in their 1995 book “Methods of Algorithm Description”. This book is great to get, because it includes examples and worked solutions of algorithm problems<br />
  8. 8. Tetris Example <br />BEGIN<br /> REPEAT <br /> REPEAT<br />Drop Brick<br />IF Left OR Right key is pressed THEN<br /> Rotate piece<br />END IF<br />IF Space Key is pressed THEN<br /> Drop brick to bottom<br />END IF<br /> UNTIL brick hits another brick<br /> IF there are a line of bricks made up<br /> Remove line of bricks<br /> Add 1 to score<br /> Add 1 to speed of bricks<br /> END IF<br /> UNTIL bricks hit top of the screen<br /> Display “End of Game”<br />END <br />
  9. 9. So, what is an algorithm?<br />
  10. 10. What’s the difference between an alorithm and a syntax structure diagram?<br />
  11. 11. So, what is a syntax structure diagram?<br />
  12. 12. Public<br />Dim<br />Variable<br />As<br />Data Type<br />Private<br />Dim [Public|Private] &lt;Variable&gt; As &lt;Data Type&gt;<br />
  13. 13. Single<br />Short<br />Boolean<br />Byte<br />Char<br />Date<br />Time<br />Decimal<br />Data Type= [Single|Short|Boolean|Byte|Char|Date|Time|Decimal|Double|Int|Long]<br />Double<br />Int<br />Long<br />
  14. 14. Upper Case<br />LowerCase<br />UpperCase<br />Variable = Uppercase {LowerCase|UpperCase|Digit}<br />Digit<br />
  15. 15. 0<br />9<br />8<br />Digit=0|1|2|3|4|5|6|7|8|9<br />7<br />6<br />5<br />4<br />3<br />2<br />1<br />
  16. 16. What now? <br />Design an algorithm for your game.<br />You also need to do syntax diagrams for all the control structures that you would need in your assignment. The control structures come from your algorithm. <br />