Friday, November 27, 2009

Turing Ch. 6 - questions at end of chapter

When you have finished reading, making notes, and trying the given programs for Chapter 6, begin working on the questions at the end of the chapter.

(Students who find this work difficult, should go to the Pickup Folder for a file named Ch06Repetition_extraPractice.doc. It gives you additional exercises to help you get used to the ideas of the chapter.)

Several of the questions at the end of the chapter challenging questions for the stronger programming students. If you can't figure those out, don't worry. You can safely ignore them.

QUESTION #9 (p. 114) asks you to find the sum of a number of terms of the series of numbers 1 + x + x**2 + x**3 + x**4 .. . This is a challenging question for the stronger students in the class.
HINTS:
- The tricky part in this question is in how you set up the counter (index) for your counted loop.
- You need to recall a little math - What's the value of x0 and x1?

QUESTION #13 (p. 115) asks you to find all the factors of an integer.
HINTS:
- Try all integers from 1 to the number.
- For each one, how do you decide whether it is a factor? Well, a factor of a number divides into the number evenly. That's the definition of a factor.
- Hint: Have a look at a very useful operator called div (p. 101).

QUESTION #14 (p. 115) asks you to take an integer from the user and output the number of digits in it. This is a challenging question for the stronger students in the class.
HINTS:
- Tell the user to enter an integer of 6 digits or less. The book doesn't mention this, but obviously there's a problem if the user can enter ANY number, no matter how large.
- Use div and multiples of 10 as a divisor.

QUESTION #16 (p. 115) asks you to generate random real numbers between, 4 and 5, 0 and 10, and so on. Be sure you learn how to do this. (It's not hard once you think about it, knowing what rand(number) does.)

Wednesday, June 17, 2009

Final TIK2O1 marks


Have a great summer!



Final marks may be viewed either in Google Docs at
http://tinyurl.com/nazcet

          or here     ↓

Friday, March 27, 2009

Try these questions from old test

1. Write a program named target.t that does the following:
• in an Execution window of 500x500 pixels, creates a brightred and white target exactly fitting in the window, as illustrated, with each ring 50 pixels wide


2. Write a program named flower.t that does the following:
• creates a flower with four petals as illustrated, the outlines of the petals in blue, the centre circle of radius 25 pixels and coloured green. The tips of the petals exactly touch the corners of the screen
• the flower should fill the Execution window as shown, no matter what size the screen is set to


3. Create a simple shape that represents a spaceship. Animate it so that it appears to be launching from the bottom left of the screen to beyond the top right of the screen. Then make the spaceship accelerate as it moves up and across the screen. Then re-design your spaceship to make it look a little more realistic.


4. Write a program that makes a balloon float from the bottom of the screen to disappear off the top of the screen. When it disaapear, another ballon does the same thing, starting froma different position.

4. Write a program that drops a rectangle from a random point along the top of the screen, like the game Tetris. When it reaches the bottom, it disappears and another rectangle drops from a different random points along the top of the screen./

Tuesday, February 10, 2009

Ch 7 Test Postponed (again).
Now on Tue., Feb. 24


Thurs. Feb. 12 - Finish Turing Ch. 7 in class
Fri. Feb. 13 - P.D. Day
Tue., Feb. 17 - Begin Turing, Ch. 8 (Pixel Graphics)
Thurs., Feb. 19 - Class canceled (Parent Interviews)
Fri., Feb. 20 - Computer lab unavailable (new computers being installed). Meet in Rm. 231. Bring seat work (e.g. study for Turing test on Ch.7 )
Tue., Feb. 24 - Test on Turing Ch. 7 (Character Graphics)

Tuesday, January 13, 2009

Schedule for coming two weeks

Tue.     (Jan. 13) - Norton 27
Thur.  (Jan. 15) - Norton 27
Fri.      (Jan. 16) - Turing 7
Tue.    (Jan. 20) - Turing 7
            (No test allowed because of Civics test)
Thur. (Jan. 22) - TEST on Norton 27
Fri.      (Jan 23) - Turing 7

Friday, December 12, 2008

Test on Turing, Ch. 6 next Friday, Dec. 19

There will be a test on Turing, Ch. 6 next Friday, Dec. 19.

It is not intended to be challenging. There will be plenty of simple, straightforward
questions to be answered on paper, enough of them so that anyone who has studied the notes can earn a good overall mark on the test. Some of the questions will even be True or False! How easy is that?

Whether you find writing programs in Turing easy or hard, you do of course have to learn what is in your notes. That's obvious, right? It's not many pages to study. Check your answers against the .pdf file in the Pickup Folder.




Also on the test, in addition to the questions answered on paper, will be a few questions requiring you to write short programs in Turing. At least two of them are meant to be easy. They will simply ask you to write something like the programs in
-- the content of the chapter, or
-- the "Practice Exercises" in the Pickup Folder, or
-- the easier questions at the back of the chapter.

By the way, we will look at the questions at the end of the chapter in class next week and you will be give model solutions for all of them.

There will probably be one programming question a little more challenging, just so some people don't get completely bored.



DO NOT BE ABSENT. Yes, Friday is the last day before the holidays, but the class did not want the test on Wednesday, so it was postponed until Friday.

Sunday, November 23, 2008

Turing, Ch. 6 - repetition (loops)

In Chapter 6 you learn how to create repetition in a Turing program.

Remember the repetition you created in Scratch using the "forever block"? In more traditional programming languages, such as Turing, a similar structure is known as an infinite loop. That is, it continues without stopping. We use infinite loops in later chapters with graphics to create endless patterns and colours on the screen.

More often you will want some sort of loop you can control not to go on forever. We will look at two:

-- the conditional loop, which ends when some variable meets a certain condition, such as a number becoming more than 100

-- the counted loop, which continues only the number of times you want it to.