5.12. Nested Repetition StatementsLet us present another complete example. We use nested repetition statements to solve the problem. Consider the following problem statement:
Your program should draw the square as follows:
After reading the problem statement, we make the following observations:
The Visual Basic class and test program that solve this problem are shown in Fig. 5.17 and 5.18. Figure 5.17. Nested repetition statements used to print a square of symbols.
Figure 5.18. Using class Box to draw a square.
|