Advanced Control: Do/while and Switch Statements
Due: Monday, Oct 1, 5:00 PM
-
Do Exercise 5.6 in the text as a Windows Application.
Specifically, use a Label component from the Toolbox to print your
results. See Section 4.12 (Pages 131-143) for an example of how to use
a Label component. (Note: you may have to size things differently from
that example to get your results to fit properly.)
-
Do Exercise 5.7 in the text as a Console Application.
However, you should repetitively prompt the user for which pattern she
wishes to see: the user should either type "A", "B",
"C", or "D" (or the lowercase equivalent). Use a switch
structure to test for each possibility, and use the default case
statement to cause termination of the program. [Note:
the occurrences of "WriteLine" in the problem description should
instead be "Write".]
|