1 / 3

Variables Table

Hand execute the program with inputs 20, 7, -1. Variables Table. SET total TO 0 RECEIVE nextInput FROM (INTEGER) KEYBOARD WHILE nextInput != -1 DO     SET total TO total + nextInput     RECEIVE nextInput FROM (INTEGER) KEYBOARD END WHILE SEND total TO DISPLAY.

lydie
Télécharger la présentation

Variables Table

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Hand execute the program with inputs 20, 7, -1 Variables Table SET total TO 0 RECEIVE nextInput FROM (INTEGER) KEYBOARD WHILE nextInput != -1 DO     SET total TO total + nextInput     RECEIVE nextInput FROM (INTEGER) KEYBOARD END WHILE SEND total TO DISPLAY Expression evaluator

  2. Hand execute the program with 13 as the input for searchKey Variables Table SET found TO FALSE SET numList TO [8,9,13,4] RECEIVE searchKey FROM (INTEGER) KEYBOARD SET pos TO 0 WHILE found  TRUE AND pos < length (numList) DO IF numList [ pos ] = searchKey THEN SET found TO TRUE ELSE SET pos TO pos + 1 END IF END WHILE Expression evaluator

  3. Descriptions SET lotto_player TO [“”, ””, ””, ””] FOR player FROM 0 TO 2 DO SEND “Please enter players name” TO DISPLAY RECEIVE name FROM (STRING) KEYBOARD SET lottoPlayer[ player ] TO name END FOR selected = pick_random( 0, 2 ) SEND lotto_player [ selected ] & “has won!” TO DISPLAY

More Related