Friday, January 30, 2015

Lesson 1 - Computer components and of course "Hello World"

This is the point where I start the sales pitch about computer programming, because it is important to have a student who wants to learn.  My students did not start on the same week so I did the introduction session separately.  This was good because I found out their interests and sold programming tailored to them.  Generally, however, I intend to make the programs as fun as possible to keep interest.  Games and creation of games is one way that we will make it fun.

In the first class I opened up a desktop computer and went over the different components.  Luckily it was their first time to see the inside of a computer, so this was great.  During follow on sessions, I tied back into the different components.  When we create a variable, I ask them, "What component is the variable stored in when the computer is running?  Or when we save a python file, I ask, "Which component is it being saved on?"  The knowledge level here is fairly basic, but I will grow it as we proceed. We covered a little more than the short list below, but here are the big take-aways:

CPU - Brains of the computer - Executes the programs
RAM - Temporary storage - Stores programs and program data during execution
Hard Drive - Permanent storage - Stores programs and program files.
Motherboard - Main circuitry - Connects the CPU to the other components.

We opened up Edubuntu and navigated through the GUI.  Although it was a new GUI to them, my students had no problem with this.  I tested their typing a little bit with the tux typing game and encouraged them to play it from time to time.  We then opened the terminal and went to the CLI, this was new territory.

I explained you are located inside of a working directory and navigate with "change directory, cd". What I found that helped was to open up the home folder in the gui, navigate those directories and "ls" to list the contents.  We created a python folder inside of the home directory and created a new python file called "hello.py" with the contents below:

print("hello i am a program")

We ran the program with the command "python hello.py" I explained, this isn't much of a program but it is one and showed various other linux programs like top, df, pwd, whoami, and id.

Next session we created a high-low guessing game and I taught them the binary search technique.

No comments:

Post a Comment