Upload
others
View
2
Download
0
Embed Size (px)
Citation preview
The Smartboard crashed and I lostthe images from the 12:30 class.
This shows a solution to the problemwe worked on last class last week.
Title: Oct 910:48 AM (1 of 16)
Title: Oct 911:08 AM (2 of 16)
Title: Oct 911:19 AM (3 of 16)
Title: Oct 911:22 AM (4 of 16)
When you set up a loop you need to handlethe three criteria listed below.
Title: Oct 911:28 AM (5 of 16)
The do has no condition so the contents of the loop isexecuted once and then the while checks to see if theloop should be executed again.
Title: Oct 911:30 AM (6 of 16)
Test the one where the condition was at thetop of the loop we find that it would not enterthe loop if we entered 0.
Title: Oct 911:31 AM (7 of 16)
This program has a couple of alerts to showdata at a certain point an excellent debugging technique.
Title: Oct 911:33 AM (8 of 16)
Title: Oct 911:33 AM (9 of 16)
I entered 10, 20, 30 so far and I will enter 40 and 50 nefore the loop ends.
Title: Oct 911:34 AM (10 of 16)
Title: Oct 911:38 AM (11 of 16)
Title: Oct 911:42 AM (12 of 16)
1)
2)
3)
class asked to add code to tell which playerwas the winner
Title: Oct 911:50 AM (13 of 16)
An example that might help.
Title: Oct 911:57 AM (14 of 16)
Title: Oct 912:01 PM (15 of 16)
Title: Oct 912:19 PM (16 of 16)