Writing Loops - SETI

Views:
 
Category: Education
     
 

Presentation Description

A process to make writing loops easier

Comments

Presentation Transcript

Writing Loops – S.E.T.I.: 

Writing Loops – S.E.T.I. How to write loops more easily …. But first …. ALIENS

Writing Loops – S.E.T.I.: 

Writing Loops – S.E.T.I.

Writing Loops – S.E.T.I.: 

Writing Loops – S.E.T.I. Life Non-Intelligent Intelligent Then God said, “Let us make mankind in our image, in our likeness, so that they may rule … Genesis 1v26 1700 1500 200

Writing Loops – S.E.T.I.: 

Writing Loops – S.E.T.I. S earch for E xtra T errestrial I ntelligence

Writing Loops – S.E.T.I.: 

Writing Loops – S.E.T.I. It is by the name of Jesus Christ of Nazareth, whom you crucified but whom God raised from the dead, that this man stands before you healed. 11 Jesus is “‘the stone you builders rejected, which has become the cornerstone.’ [ a ] 12 Salvation is found in no one else, for there is no other name under heaven given to mankind by which we must be saved.” Acts 4 verse 10-12

Writing Loops – S.E.T.I.: 

Writing Loops – S.E.T.I. S tartup What needs to be done before the loop E ntry / Exit When do we get in or get out of the loop T ask What does the loop do each time I terate What needs to happen before the next time thru the loop

Writing Loops – S.E.T.I.: 

Writing Loops – S.E.T.I. Read price total = 0 Read price Add price to total Print total Is price 0? Yes No S tartup E ntry / Exit T ask I terate Cash register program Uses a “sentinel” I terate T ask E ntry S tartup the loop

Writing Loops – S.E.T.I.: 

Writing Loops – S.E.T.I. Read in numbers Read in number highest = number lowest = number FOR numberupto = 2 to numbers Read number IF number < lowest THEN lowest = number ENDIF IF number > highest THEN highest = number ENDIF NEXT numberupto Print highest “-” lowest S tartup E ntry / Exit T ask I terate Range program Eg: 6, 4, 1, 7, 9, 3, 2 9-1 I terate T ask E ntry /Exit S tartup the loop

Writing Loops – S.E.T.I.: 

Writing Loops – S.E.T.I. Read guess turns = 0 REPEAT Choose picked from 1..100 turns = turns + 1 UNTIL guess = picked Print turns S tartup E ntry / Exit T ask I terate Number guesser program Prints how long til computer guessed it I terate T ask E xit S tartup the loop

Writing Loops – S.E.T.I.: 

Writing Loops – S.E.T.I. S tartup E ntry / Exit T ask I terate