Bismillahirrahmanirrahim..
Our life such a Programming language that use to command our pc to do something. either you accept it or not, our life is always like a programming language. Why? Let’s we see it together..
Before that, let we know that every programming language is divided into three important things ; the header, body and footer.
First at all, to get an input to our programming language ,we must put the heading file either we want to use #include
Secondly, after write the heading file, we must write the int main ( ) / int main (void) and others depend on what we want to do after that,we must open our ‘body’ of programming language with { . so now, we already have 3 important things that we must write/do before we start our program
1) Begin our program with #include
2) Put the main file : int main() / int main(void)
3) Continue it with {
Assume that the main file : int main( ) / int main(void) and { is are the rule in Islam that we MUST do to get the actual “output” of our “programming “ . after declare our syahadah means we has been ready and able to follow all of the rule in Islam that we declared for our life.
Now, we continue our programming with body. In programming’s body, usually we will found two types of selection that we need to choose depends of what we want to do. Every choice that we make will give some impact to our output and if we failed to chose and failed to use it correctly, we will not get the output like we want and nether will not get the output. As I know, in programming we have two types of selection .
1) If = if is a selection when we have only one choice. For example
If (Islam)
Cout << “boleh dipertimbangkan utk Masuk syurga\n”;
Else
Cout <<”jika tidak kemabali kpd Allah,akan masuk neraka\n”;
2) If...else = if...else is a selection when we have more than one choice and it will make something more complicated. For example :
{
If (solat 5 waktu )
{
If (selalu buat baik)
Cout << “Allah sayang \n”;
}
else
{
If( dapat hidayah)
{
If (terima hidayah tersebut)
Cout << “beruntunglah dia \n” ;
}
else
Cout <<”Dialah manusia yg paling rugi.. rugi didunia,rugi juga diakhirat. \n”;
}
Ok.stop about selection. Now we continue our programming with something that usually we’ll found it in programming ; the loop. There’s no ‘loop’ in our life actually because the time that already pass will not come again but sometimes, something that we do in our past will happen for a second time in our future either it will happen to us or our offspring, depends on Allah’s need. It is we call ‘qisas’ in our life.
The loop in programming language is divided into three ; While,do...while and for. In programming, we use loop when we want to produce much of output and every type of loop that we choose to use will affect the output that we will get.
1) While = while is a loop that produce the output while the condition is true. Example :
Life = 60 years
{
While ( Life <= 60)
Cout <”beramallah sebelum mati \n”;
}
2) Do...while = do...while look like the while loop but it is quite different. The condition of do...while loop will test in the end of the loop so that the program will produce at least one output . for example :
{
Do (worship to Allah)
}
note : last day,I feel so sleepy in my programming class so that I was do some revision in the nite and I this is what I get when I make a revision alone by myself..hu2..hope you can get something from here..
No comments:
Post a Comment