Learning to Program
The Basic programming language is a really nice abstraction for a physical computer. As a language it has the notion of an instruction pointer (line numbers) and a stack pointer (using GOSUB). The entire language description fits on a page. A great way to teach it is using the javascript Apple II Basic emulator (which is frankly amazing).
http://www.calormen.com/jsbasic/
Good assignments are:
- Print “Hello World”
- Write a program that takes two numbers as INPUT and adds them
- Write a program that prints all the integers less then 100
- Write a program that prints all the integers less then 100 by powers of two.
- Write a program that takes a number as input and then counts up by that number (for example if you entered 5, it would count 5, 10, 15 …)
- Write a guess a number game (it picks a random number between 1 and 100, makes you guess until you get it telling you if you are too high or too low)
- Write a program that prints takes a number as input and prints all the factors of a number.
- Write a program that takes a number as input and tells you if a number is prime or not.
- Print a list of prime numbers
- Print a list of prime numbers as fast as you can.
- Find perfect numbers and print them (a perfect number is a number equal to the sum of all its factors not including itself, for example 6 is perfect because its factor are 1+2+3)
10
Kudos
10
Kudos