Today, I have an algorithm and programming class. This is basically our first class, cause last week we had a holiday. Some of the materials from this class have been delivered to us during the Academic Orientation (AO). Here’s what I got from today’s class.
First, we had a quick look on Object Oriented Programming (OOP) especially Java. We learned about 5 common terms in OOP. We also had the chance to hear some experiences from Feri Lauw, the CEO and CTO of AnakRimba and a binusian alumni as well. Here are 5 terms in OOP especially Java that we learned:
- Encapsulation: Private and Public.
- Abstraction : Able to choose which “attribute” that wanted to be descent and shown
- Interface : The highest “parent” or source which able to use “attribute” from other sources
- Polymorphism : being able to use several method or object effectively
- Inheritance : able to hide their inherited “attribute” and do their own stuff
We also learned about the beginning of algorithm. First algorithm was invented by Al-Kwarizmi. Algorithm can be written in two ways, Pseudo-code and Flowchart. Pseudo-code uses normal human language so that other people can understand it. Pseudo-code can also be transformed into different programming language in the end. Pseudo-code includes input, process (which contains compute, store, compare, and loop), and output. Flowchart uses diagrams cause human understand diagrams better than normal texts. Flowchart always have a start and end.
Algorithm itself can be implemented into a program’s source code. Then the source code will be transformed into executable code so that computers can understand and run the program. We then have to compile the program. Sometimes we encounter errors during the compilation process. This error usually means that we write the wrong codes. This error also called syntax error.
After we get pass through the compilation process and all of the syntax error, we can do some testing on the program to check if the program gives us the right output. If we do get the wrong output, it means that we have encounter output errors. This type of error might be caused by the code we wrote, or even the algorithm itself. After passing through all of those steps, then we can make documentations of that program.
The next thing we learned is about procedural programming language like C. This type of programming language is based on structure. The structure can be formed by sequences, selections (if-else), and even repetition/loop/iteration (Do-while).
C programming language, although it is old, but still being used because of its flexibility, portability, large amount of libraries, and because it is well-known. C programming language is also case sensitive and every statement inside C should be ended with semicolon (;). There are also comments (/* */ or //), some keywords like auto, variables, and data. That’s all the lesson I have got today.