First week of programming

We started our programming course this week. After the introduction this monday, we went through different variables this tuesday. After tuesday’s lesson, I did some of the practise exercises on my own. The problem came when I ended up with exercise 11. Here’s the description of exercise 11:

  • Let the user input two integer values.
  • Square the first variable and divide by the second.
  • Assign the result to a floating point variable.
  • Output the result
  • Compile and run

The issue with this exercise was that my sum of the two integers never would show up as a float value in the result. This made me look around the internet on how to do this, and I eventually managed to fix it so that the value would show as a float. But when I showed this to our teacher, he said that the point was that it shouldn’t be shown as a float value. So I had made the exercise harder than it really was, which was very educational to me.

This thursday, we went through a lot of things. How to use ”if, else if, else, for, while, do while, switch, break, continue” and so on. We also went through what a scope is, and had a short introduction to debugging. All in all, it was a very educational and good first week of this programming course, and I’m looking forward to next week already.

About Olle Staffas

2014  Programming