19.04.2017 Views

Learn to Program with Small Basic

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

128 Chapter 9<br />

3. Obi-Wan Kenobi needs <strong>to</strong> know the day of the week. But R2-D2 just beeps<br />

at him. Obi-Wan counts the beeps, but he needs your help <strong>to</strong> translate<br />

that number in<strong>to</strong> the day of the week. Write an If/ElseIf ladder that compares<br />

the value of the variable dayNum <strong>with</strong> 1, 2, 3, . . . , 7 and sets the value<br />

of the variable dayName <strong>to</strong> "Sunday", "Monday", "Tuesday", . . . , "Saturday"<br />

(so 1 is Sunday and 7 is Saturday). Help Obi Wan Kenobi. You’re his<br />

only hope!

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!