16
The Smartboard crashed and I lost the images from the 12:30 class. This shows a solution to the problem we worked on last class last week. Title: Oct 910:48 AM (1 of 16)

Title: Oct 911:08 AM (2 of 16) - Bristol Community Collegecisweb.bristolcc.edu/~pgrocer/audio_smartboardF18/CIS120/c12011Oct918.pdfThe Smartboard crashed and I lost the images from

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Title: Oct 911:08 AM (2 of 16) - Bristol Community Collegecisweb.bristolcc.edu/~pgrocer/audio_smartboardF18/CIS120/c12011Oct918.pdfThe Smartboard crashed and I lost the images from

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 9­10:48 AM (1 of 16)

Page 2: Title: Oct 911:08 AM (2 of 16) - Bristol Community Collegecisweb.bristolcc.edu/~pgrocer/audio_smartboardF18/CIS120/c12011Oct918.pdfThe Smartboard crashed and I lost the images from

Title: Oct 9­11:08 AM (2 of 16)

Page 3: Title: Oct 911:08 AM (2 of 16) - Bristol Community Collegecisweb.bristolcc.edu/~pgrocer/audio_smartboardF18/CIS120/c12011Oct918.pdfThe Smartboard crashed and I lost the images from

Title: Oct 9­11:19 AM (3 of 16)

Page 4: Title: Oct 911:08 AM (2 of 16) - Bristol Community Collegecisweb.bristolcc.edu/~pgrocer/audio_smartboardF18/CIS120/c12011Oct918.pdfThe Smartboard crashed and I lost the images from

Title: Oct 9­11:22 AM (4 of 16)

Page 5: Title: Oct 911:08 AM (2 of 16) - Bristol Community Collegecisweb.bristolcc.edu/~pgrocer/audio_smartboardF18/CIS120/c12011Oct918.pdfThe Smartboard crashed and I lost the images from

When you set up a loop you need to handlethe three criteria listed below.

Title: Oct 9­11:28 AM (5 of 16)

Page 6: Title: Oct 911:08 AM (2 of 16) - Bristol Community Collegecisweb.bristolcc.edu/~pgrocer/audio_smartboardF18/CIS120/c12011Oct918.pdfThe Smartboard crashed and I lost the images from

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 9­11:30 AM (6 of 16)

Page 7: Title: Oct 911:08 AM (2 of 16) - Bristol Community Collegecisweb.bristolcc.edu/~pgrocer/audio_smartboardF18/CIS120/c12011Oct918.pdfThe Smartboard crashed and I lost the images from

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 9­11:31 AM (7 of 16)

Page 8: Title: Oct 911:08 AM (2 of 16) - Bristol Community Collegecisweb.bristolcc.edu/~pgrocer/audio_smartboardF18/CIS120/c12011Oct918.pdfThe Smartboard crashed and I lost the images from

This program has a couple of alerts to showdata at a certain point ­ an excellent debugging technique.

Title: Oct 9­11:33 AM (8 of 16)

Page 9: Title: Oct 911:08 AM (2 of 16) - Bristol Community Collegecisweb.bristolcc.edu/~pgrocer/audio_smartboardF18/CIS120/c12011Oct918.pdfThe Smartboard crashed and I lost the images from

Title: Oct 9­11:33 AM (9 of 16)

Page 10: Title: Oct 911:08 AM (2 of 16) - Bristol Community Collegecisweb.bristolcc.edu/~pgrocer/audio_smartboardF18/CIS120/c12011Oct918.pdfThe Smartboard crashed and I lost the images from

I entered 10, 20, 30 so far and I will enter 40 and 50 nefore the loop ends.

Title: Oct 9­11:34 AM (10 of 16)

Page 11: Title: Oct 911:08 AM (2 of 16) - Bristol Community Collegecisweb.bristolcc.edu/~pgrocer/audio_smartboardF18/CIS120/c12011Oct918.pdfThe Smartboard crashed and I lost the images from

Title: Oct 9­11:38 AM (11 of 16)

Page 12: Title: Oct 911:08 AM (2 of 16) - Bristol Community Collegecisweb.bristolcc.edu/~pgrocer/audio_smartboardF18/CIS120/c12011Oct918.pdfThe Smartboard crashed and I lost the images from

Title: Oct 9­11:42 AM (12 of 16)

Page 13: Title: Oct 911:08 AM (2 of 16) - Bristol Community Collegecisweb.bristolcc.edu/~pgrocer/audio_smartboardF18/CIS120/c12011Oct918.pdfThe Smartboard crashed and I lost the images from

1)

2)

3)

class asked to add code to tell which playerwas the winner

Title: Oct 9­11:50 AM (13 of 16)

Page 14: Title: Oct 911:08 AM (2 of 16) - Bristol Community Collegecisweb.bristolcc.edu/~pgrocer/audio_smartboardF18/CIS120/c12011Oct918.pdfThe Smartboard crashed and I lost the images from

An example that might help.

Title: Oct 9­11:57 AM (14 of 16)

Page 15: Title: Oct 911:08 AM (2 of 16) - Bristol Community Collegecisweb.bristolcc.edu/~pgrocer/audio_smartboardF18/CIS120/c12011Oct918.pdfThe Smartboard crashed and I lost the images from

Title: Oct 9­12:01 PM (15 of 16)

Page 16: Title: Oct 911:08 AM (2 of 16) - Bristol Community Collegecisweb.bristolcc.edu/~pgrocer/audio_smartboardF18/CIS120/c12011Oct918.pdfThe Smartboard crashed and I lost the images from

Title: Oct 9­12:19 PM (16 of 16)