Seventh Lesson of Algorithm

Today, we learned about function and recursion. Function actually consist of built-in function or library function and user defined function or function that was made by the programmer.

Program is actually made of several modules. These modules can be implemented to functions. So, function is a group of statements to do a specific job. The advantages of using modules are easier to debug, easier to be modified, and can be done by several programmers.

Function syntax:

return_value_type  function_name(parameter)

{

statements;

return_value;

}

return_value_type is the data type of the returned value. If there are no value returned then use “void” data type.

parameter is the value sent to the function by user. Parameter is optional.

Function is written above the main program.

 

Recursion is a function that calls itself and repeats itself until there is a value achieved. Recursion is consist of base case,which contains a constant value, and reduction step which is a sequence of the repetition. For example recursion of factorial. However, recursion is not very effective and uses a lot of time and memory. So, it is only recommended to use recursion when it is to hard to make the iteration.

 

Today, we also learned about encryption and web security from the CEO of Dewaweb.com, Edy Budiman. We also learned about SSL certificate and how important it is to be aware of the internet’s security. That’s all for today. Thanks.

Sixth Lesson of Algorithm

This time we have a small review before the quiz.

Programming is basically the process to make input become output. This can be done with several ways like selection, repetition, and storage.

In selection, we use if condition, if-else condition including nested if, and switch-case. In repetition, we use for, while, and do-while.

After that, we also do some practice like making square and diamond shape using C language.