Monday, March 9, 2009

Update on computer programming instruction

I'm still waiting on whether a friend can help me figure out how to make SCHEME work interactively; I've downloaded Scilab but haven't figured out how to run it (when I click on the icon, nothing happens); I haven't yet tried out Python and Scratch.

In the meantime, I'm using what's already up and running--namely, javascript. I introduced this to J. years ago, and he's learned how to create basic html pages with buttons that make calls to simple js code. But now I'm attempting to teach him, systematically, some more basic programming, and thought I'd share his assignments as I make them up.

Assignment 1: write program that prints out numbers 1 to 20; 5 to 30; 100 - 150 (introduces alert() and for-loops)
Assignment 2: write a program that asks for two numbers and prints out all the numbers between them (introduces prompt() and variables)
Assignment 3: write a program that prints out all the multiples of 5 between 1 and 100 (introduces multiplication operator)
Assignment 4: write a program asks for a low number, a high number, and a factor and prints out all the multiples of that factor that are between the low number and the high numbers (combines tools from assignments 1-3).
Assignment 5: write a program that determines whether a give number is odd (introduces if...else)
Assignment 6: write a program that determines whether a given number is prime (introduces "break" for breaking out of loops; applies all the above tools to a mathematical problem). This one was a challenge; we had to spend time going over the value of the looping variable at different points within the loop and at the exit point.
Assignment 7: (next one on the agenda) write a program that lists all the factors of a given number. Stay tuned!

1 comment:

Anonymous said...

It may be awhile before J is ready, but check out Project Euler, "Project Euler is a series of challenging mathematical/computer programming problems that will require more than just mathematical insights to solve. Although mathematics will help you arrive at elegant and efficient methods, the use of a computer and programming skills will be required to solve most problems."