As with all first weeks of your life (and mine too, although its a little longer than yours 8-), its hectic and full of unknowns. Not knowing where the classrooms are, not knowing what the module is about, not knowing if the lecturer/s is/are good or not. Welcome to the real world. 8-)
As I have mentioned in the previous post, this blog will primarily contain the archive of the salient points of the module as we go along. I will strive to update it once a week, the keyword being strive. 8-) If you have any questions, please feel free to leave a comment so that we can all learn from each other.
Ok, for the first week, as it is only the start of the semester, we introduced the concept of programming and what writing computer programs is all about. Remember the
PacMan game that I mentioned, as an example of a simple computer program? Right, so:
- a computer program is simply a set of instructions that you give to the computer for it to perform some actions for you,
- programming languages are the languages used to 'talk' or 'tell' the instructions to the computer,
- Java is just one of the many programming languages
So in the weeks to come, we will be learning the syntax, or the rules, of the Java programming language, as well as the logic, or algorithm, of computer programming so that we can write useful computer programs.
We also started with Lab 1 on writing simple logic or algorithms, in pseudo codes, to get our brains to think logically so that we can later formulate the logic into Java codes to program into the computer. The key thing to note in writing pseudo codes (whether using pen and paper or mentally in your brain) is to try to be as explicit and clear as possible. Remember that the computer cannot think, so it will not be able to do intelligent actions for you unless you instruct it to. Hence instructions, in the form of pseudo codes, need to be thorough and clear.
In the lab, we wrote (or at least you, I have written mine long ago 8-) our first Java program,
HelloWorld.java, using TextPad and JDK. Do remember these steps on writing a Java program, as you will be doing this on your own from next week onwards.
- Open TextPad and type in your Java codes.
- Save the file as .java.
- Open up a command prompt window and navigate to the folder where you saved the Java file.
- Use the command: javac .java to compile the Java program.
- Use the command: java to run the Java program to see if it works according to what you want it to work.
Do leave comments if you have questions on what was covered this week!