mdinfotech.net  



  1. To earn an extra 5% AT THE END OF THE SEMESTER ONLY, complete all of the challenge exercises for your grade.
  2. Print this form, fill it out and give it to Ms. Wear BEFORE the due date.
  3. Follow instructions on individual challenge. Assignments can usually be printed, emailed or posted on a website.
Print this Bits and Integers Worksheet. Complete and hand in with a completed hardcopy of the Challenge Form.
Write a program that will read the two integers from the user then display in the console all positive even integers that lie in the range of integers from the smaller to the larger. If one (or both) of the input integers are also even, they must be included in the output. Assume the first number is less than the second.

Email the completed assignment to wear@mdinfotech.net. Print the Challenge Form, fill it out and put it in Ms. Wear's Wire Inbox BEFORE the due date.
Create an program that randomly generates (using Math.random) two (x,y) coordinates and draws a rectangle between them. Then use a loop to repeat the program 20 times. Randomize the colours and sizes of the rectangles. The result will be a program that draws 20 randomly placed, sized and coloured rectangles on the screen. The result will change each time you run the program. You will need to know Math.random and the for loop.

Email the completed assignment to wear@mdinfotech.net. Print the Challenge Form, fill it out and put it in Ms. Wear's Wire Inbox BEFORE the due date.
Write a program to decrypt a message sent between two naughty students in ICTP 11, encrypted with Code 13. An example message looks like this:
3-6-4
ELBHAD ROQBW GB EBXXBL XNDH UIY!
Code 13 is a set of any 3 numbers that add to 13. They appear at the beginning of the message. The recipient then writes down the letters of the alphabet in 3 paired columns, the lengths of which correspond to the three numbers given. For the key 3-6-4, the recipient would produce a decryption table that looked like this:
A=D    G=M    S=W
B=E    H=N    T=X
C=F    I=O    U=Y
       J=P    V=Z
       K=Q
       L=R
The message above decrypts to
Brenda likes me better than you!
Assume all letters are capitalized and punctuation does not get encoded.

Email the completed assignment to wear@mdinfotech.net. Print the Challenge Form, fill it out and put it in Ms. Wear's Wire Inbox BEFORE the due date.
Write a program to create a calendar for one month given the numerical value of the month (Jan is 1, Feb is 2 etc) and the year (assume 1500 <= year <= 9999), both of which are entered by the user. Your program will display, in the console, a calendar for that month, in the same format as shown below. Assumptions:
  • any year divisible by 4 is a leap year (not true, but assume it is)
  • the Gregorian calendar applies to all years from 1500 onwards
  • January 1, 1500, was a Monday
  • for the number of days in each month, remember this poem:
    Thirty days hath September, April, June, and November. All the rest have thirty-one, Excepting February alone, And that has twenty-eight days clear, And twenty-nine in each leap year.
Example of Program Execution

Enter month: 3
Enter year: 2012
  March 2012
  S   M   T   W   T   F   S
                  1   2   3
  4   5   6   7   8   9  10
 11 w 12  13  14  15  16  17
 18  19  20  21  22  23  24
 25  26  27  28  29  30  31


Email the completed assignment to wear@mdinfotech.net. Print the Challenge Form, fill it out and put it in Ms. Wear's Wire Inbox BEFORE the due date.