To Takehome Quizzes

                         IT 236 -- Quiz 3 

1. (25 pts.) Write a Console application that does these things:
    (a) Declare an array of size 5 that contains doubles.
    (b) Assign 3.545 to the item of index 0,
               23.322 to the item of index 1,
               -0.5733 to the item of index 2,
               548.48 to the item of index 3,
               5.9558 to the item of index 4.
    (c) Print the items using a traditional For loop.
    (d) Declare and initialize a string array that contains the 
            items dog, cat, mouse, canary, ferret, goldfish.
    (e) Print the items using a For Each loop.

For 2 (25 points), 3 (25 points), and 4 (25 points) write code for 
the VB.NET event handlers to solve the problem.  Only include code 
the the event handlers that you write, not the Windows Forms Designer
code written by the IDE.

2. Write code for a windows application that toggles the text color on
   a button between blue and green when it is clicked. 

   Hint:  The equality operator = does not work for comparing colors.
   Instead, define a Private Boolean variable to keep track of whether
   the current text color of the button is blue (True) or not 
   blue (False).

3. A copy center charges 5 cents per copy for the first 100 copies
   and 3 cents each for each additional copy.  Write a windows 
   application that inputs the number of copies ordered and outputs 
   the total cost.

4. The current calendar, called the Gregorian Calendar, was 
   introduced in 1582.  Every year divisible by 4 is declared to ba
   a leap year, with the exception of years ending in 00 (divisible
   by 100) that are not divisible by 400.  For instance, the years
   1700, 1800 and 1900 are not leap years, but 1600 and 2000 are.
   Write a Windows application that inputs a year and outputs
   "Is a leap year" or "Is not a leap year."

   Use the Mod operator to test for divisibility.

   The expression   n Mod m   computes the remainder when dividing 
   n by m using integer division.  For example,  17 Mod 7 is 3
   because 17 \ 7 is 2 with a remainder of 3.

   The condition  year Mod 100 = 0  is True when year is evenly
   divisible by 100 (no remainder) and False otherwise.  You can
   also use  year Mod 4 = 0  and  year Mod 400 = 0.