Workshop

   

The Workshop is designed to help you anticipate possible questions, review what you've learned, and get you thinking about how to put your knowledge into practice. The answers to the quiz are in Appendix A, "Answers to Quizzes/Exercises."

Quiz

1:

True or False: You have to know the start and end values of a for loop at design time to use this type of loop.

2:

Is it possible to nest loops ?

3:

What type of loop would you most likely need to create if you didn't have any idea how many times the loop would need to occur?

4:

If you evaluate the expression in a do while on the while statement, is it possible that the code within the loop may never execute?

5:

What statement do you use to terminate a do while without evaluating the expression on the do or while statements?

Exercises

  1. The status meter example using do while has a deliberate "bug." The meter will display only to 99 (the label's width will adjust only to 99 pixels, not 100). The problem has to do with how the expression is evaluated. Find and correct this problem.

  2. Use two for loops nested within each other to size a label in two dimensions. Have the outer loop change the Width of the label from 1 to 100 and have the inner loop change the Height from 1 to 100. Don't be surprised by the result ”the end result is rather odd.


   
Top


Sams Teach Yourself C# in 24 Hours
Sams Teach Yourself Visual Basic 2010 in 24 Hours Complete Starter Kit (Sams Teach Yourself -- Hours)
ISBN: 0672331136
EAN: 2147483647
Year: 2002
Pages: 253
Authors: James Foxall

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net