Course Contents — Links to Lessons

This connects to the course outline at http://iquark.ca/docs/JavaCourse1.html

    Unit 1
  1. LESSON: Swing drawing commands

    Read over the three PDFs that form the documentation for HSA2. You have them in your HSA2 download folder, but I'll link to them here too
    1. intro to graphics
    2. drawing commands
    3. colours and fonts

    ASSIGNMENT:

    Do some sort of attractive drawing. If you're really stuck draw a house with a sun and a cloud or make a logo You can use the template program to get started. It's in Slack.
    Make sure that you demonstrate how to do the following:

    • draw a line where you want it
    • change line thickness
    • draw a rectangle where you want it
    • draw circles (filled or outlined)
    • make your own colours
    • make semi-transparent colours
    • change fonts
    • use gc.drawString() to write onto the screen.

    We can do everything we need to in our graphics programs if we can draw rectangles, circles, lines, and change colours and fonts. There are lots of other cool things to try if you want - like polygons and arcs.

  2. LESSON: Basic Java

    ASSIGNMENT: Simple Calculator
    Instructions are here

  3. While loops and Random numbers

    While loop notes (two pages)
    Random number notes

    ASSIGNMENT:

    Random numbers: use a for loop to create 100 random numbers between 1 and 6 (simulating a dice). Count how many of each number there are and print out the result. There should be almost the same number of 1s, 2s, ... 6s. (and then I'll show you a faster way to do this using arrays).

    Use a while loop and random numbers to make random circles on your GraphicsConsole. Also create random colours for the circle. If you wish, you can add a line that clears the screen when you press the space bar. Then add code so that the program ends when you press 'Q' or 'q'.

  4. Modulus
    No assignment for modulus
    Unit 2
  1. LESSON: For Loops
    For Loop notes

    ASSIGNMENT:
    Write a for loop that prints the numbers 99 down to 0. Do this 4 different ways. The for-loop must be different each time.