Here is a slightly more complicated drawing program. It will scale a car. You get to choose a scale between 1 and 4. Most home ed families have a minivan. Your challenge is to see if you can change the pattern into a minivan. Continue reading “Yet Another Drawing Program”
Here is a follow-up drawing program similar to the draw X program. After looking at these two programs, try scaling another letter. Continue reading “Another Drawing Program”
Usually, in all of programming courses I taught, I would at some point in the course take about 15 minutes of the beginning of the class to explain something to them. For those who had me for a half dozen or more courses, this talk might have gotten a bit old. But, even then, it was worthwhile for them to remember the standpoint I was teaching from.
In this tutorial, I’ll decribed most of the commanly used operators in C. There are 2 types of operators: logical and arithematic. Logical operations produce a value of true or false. Arithematic operations return a calculated value.
Continue reading “Operators”
One of the problems programmers face is dealing with a large number of the same datatype. An example of this is this web page. If you view the page source you will see that behind the scenes a web page is a bunch of text. In talking about datatypes, I introduced the char datatype which holds 1 character. But this page consists of a few thousand characters. As a programmer, you would not want to have to create a variable for each character in the page. Programming would be a horribly inefficient means of processing a web page.
Continue reading “Arrays”
This is the first of 2 posts on conditions and iterations. Essentially this means conditional execution and repetitive operations. Using arrays and a variable to index into the array we can process an entire array without writing code which specifically accesses each element in the array.
Continue reading “Conditions & Iterations – Part 1 of 2”
This is part 2 of 2 tutorials on conditions and iterations. Essentially this means conditional execution and repetitive operations. Using arrays and a variable to index into the array we can process an entire array without writing code which specifically accesses each element in the array.
Continue reading “Conditions & Iterations – Part 2 of 2”
In this code sample, I’ve placed lots of comments. To see how well I’ve done at commenting, I’ll leave it to you to ask any questions in the forums. Continue reading “datatypes & comments example”
In the The Traditional First Program I talked about the main() function returning an integer to the operating system. int is a datatype. In C, there are a few basic datatypes. Before I talk about those, I’ll explain a bit about computers and memory.
Continue reading “datatypes”
Every programming language I’ve worked with allowed the programmer to add comments to the program. Comments are essentially programmer notes which the compiler ignores. In the small programs I’ve had here so far comments haven’t really been necessary. However, when you have a program that has 10,000 lines of code and you haven’t looked at it in a couple years, comments come in handy. A second instance where comments are handy is when you are trying to make changes to programs someone else wrote. I’ve modified programs written by other people. Some were well commented, others not. If I had not already been convinced of the value of comments, working with those poorly commented programs would have changed my mind. Continue reading “Comments”