Pages

Wednesday, April 27, 2011

Session Outline: Wednesday, April 27, 12:10 PM to 1:00 PM SURGE 112 and 2:10 PM to 4:00 PM ENGR2 129

Monday's Session

Thanks for coming everyone! I think a number of people who came forgot to sign in. If you remember you came but didn't sign in could you email me? Thanks!

Mock Midterm

The mock midterm will be today during the classroom session. It will begin exactly at 12:10 so try to get there a little early. The test will be 50 minutes, 20 multiple choice and two written response questions. I'll be able to send out a copy of the test via email next week so if you can't make it you can take it at home. But you should really come if you can (are you really going to take it if I email it to you?).

There's a limited number of seats, so if the classroom fills up I'll have to turn people away on a first come first serve basis. We should be alright though, I don't think we'll completely fill the classroom.

 

Lab Session

The lab this week will follow the same format as last week.
I've copied the lab questions below. Hope to see you guys there!
Remember: I can't help you with homework! Do the first lab option if your having issues with your homework!

Lab Option 1 (designed to help with your homework):
Create a program which draws a square with 19 squares cascading through the middle of it (so 20 squares in total). Each square should be slightly smaller than the square it's in.
Similar to the image below (except there would be 20 squares instead of 12)


I will draw a diagram on the board to illustrate exactly what I want, refer to that for help.

Lab Option 2 (designed to help you with the new material this week and next week's lab):
Prompt the user for 2 numbers, a lower bound and an upper bound (so a small number and a bigger number). Then print out every even number in between those two numbers, inclusive.
So if the user gave the numbers 4 and 19, the output would be: 4 6 8 10 12 14 16 18.

Hint: Try to first print out every number in between the two numbers, then try to get just the even numbers.
Second Hint: n % 2 == 0 will be true if n is even. Ask if your confused by this.

Lab Option 3 (designed to challenge those who are finding things easy or want to challenge themselves, for added incentive I'll buy you a danish from bytes if you successfully complete this option):
Create a program which asks the user for a number, and then draws a "Tic-Tac-Toe Board" to the screen with that number of spaces in each row (so an NxN grid). You are not making a Tic-Tac-Toe game, you are just drawing the grid.
Hint: You'll need to use a nested loop for this.
Below is a 3x3 grid. Notice the spacing between each square. The spacing is optional, if you feel like tackling it go ahead.

If you're up for a different challenge, just draw a regular 3x3 Tic-Tac-Toe board but then implement a Tic-Tac-Toe game. You won't need to use a nested loop but it will still be tricky.

No comments:

Post a Comment