Pages

Saturday, July 11, 2015

Meaningfull Lessons in The 1st Year of College

Hello and good evening!! yeah, it’s me again, Si Ar Em. This is the second time I post something in this blog. This time, just like its tittle, I’m writing about things I learned from other people (friends, lecturers, classmates, experience, and many more) in the college since the very first day. Here are some of them:

1. “Talk only when you really need to talk” is not really good
I used to talk a lot to my friends in senior high school. We talked about everything, from the unimportant things until the most unimportant things. We were so fussy, lol. Then, after entering college, I tried to talk less than I usually did, especially during the class. I talked to my classmates only if I didn’t understand what the lecturer were saying/writing or if I wanted to ask about something. Because of this, some of my new friends said that I was a calm person (maybe). Now i realize that keep doing such thing is not good. Some of my friends suggest me to talk more in order to get closer to new friends. This is tough, but should give it a try

2. Handling criticism gracefully
We all make mistakes all the time, it is human nature As we go through life we have plenty of opportunity to learn and improve ourselves. Therefore, no matter what kind of criticism is aimed at you, analyse it to find something you can learn from it. For Constructive criticism, it is designed to point out your mistakes, but also show you where and how improvements can be made. This should be viewed as useful feedback that can help you improve yourself rather than put you down. Destructive criticism on the other hand, is often just thoughtlessness by another person, but it can also be so hurtful, in a worse case, it can lead to anger. To deal with people who gave me destructive criticism, I usually responded in anger. But now I’ll handle it by thinking “they only know what I’ve done, not what I’ve been through” and try to take the positives out of the criticism itself. It’s kind of difficult tho..

3. Stay focused when you are in the ATM
Around February 2015, After I took the money from the ATM, probably I didn’t concentrate and forgot to take back the debit card from the machine. It was swallowed accidentally. I was a little bit panic + stressed in that time, so I went to the nearest bank immediately to block the debit card. Since that day, I always try to get focused first before taking money in the ATM.

4. Don’t leave your food in the bedroom for too long
I usually left (forgot) food in my bedroom (sweet foods, flesh or greasy foods). When I came back to my the bedroom, “Damn it, my food, full of ants!!!” ,”oh, I hate ants very much!!”. Yes, tiny red ants crawling on the food all over. I tried to dust them off, but no success, even “shit!, I got bitten”. Finally I decided to kill them and throw (away) my food because I had no idea whether the food is safe to eat after ants have gotten on it or not. From now on, I won’t do that again.


That’s all that I can write this time.. see you again next time..

Sunday, April 19, 2015

Program Pascal Kalkulator Sederhana

Pemrograman... sekarang ini, selain bleajar statistik di salah satu ptk di Jakarta, saya juga diajarkan tentang pemrograman dalam mata kuliah Algoritma Pemrograman atau lebih dikenal dengan Alpro. Bahasa pemrograman yang digunakan adalah bahasa pascal.

Mengenai pemrograman, pernahkah Anda berpikir bagaimana program dalam kalkulator dibuat? Nah, berikut ini merupakan sebuah program pascal kalkulator sederhana yang saya buat...

Program Mr_Calculator;
Uses crt;
Label
  1000,2000;
Var
  x,y,z:real;
  operator,menu:char;
Begin
1000:
  clrscr;
  writeln;
  writeln('WELCOME');
  writeln;
  writeln('Mr_Calculator created by CHANDRA RINALDY MBURA');
  writeln;
  writeln('Masukkan angka pertama: ');readln(x);
  writeln('Pilih operator:(+),(-),(*),(/)');readln(operator);
Case operator of
  '+':begin
        writeln('Masukkan angka kedua');readln(y);
        z:=x+y;
        writeln('Hasil dari operasi ',x:0:2,' + ',y:0:2,' adalah ',z:4:2);
      end;
  '-':begin
        writeln('Masukkan angka kedua');readln(y);
        z:=x-y;
        writeln('Hasil dari operasi ',x:0:2,' - ',y:0:2,' adalah ',z:4:2);
      end;
  '*':begin
        writeln('Masukkan angka kedua');readln(y);
        z:=x*y;
        writeln('Hasil dari operasi ',x:0:2,' * ',y:0:2,' adalah ',z:4:2);
      end;
  '/':begin
        writeln('Masukkan angka kedua');readln(y);
        z:=x/y;
        writeln('Hasil dari operasi ',x:0:2,' / ',y:0:2,' adalah ',z:4:2);
      end;
  else
    writeln('Maaf Dalam Mr_Calculator hanya terdapat operasi (+),(-),(*) dan (/)');
  end;
2000:
  writeln('Tekan Y untuk mengulang atau N jika telah selesai');readln(menu);
  case menu of
  'Y':goto 1000;
  'y':goto 1000;
  'N':writeln('THANK YOU for using Mr_Calculator');
  'n':writeln('THANK YOU for using Mr_Calculator');
  else
    writeln('ERROR');
    goto 2000;
  end;
readln;
end.

Screenshot pada Turbo Pascal

part1

part2

part3









Setelah program tersebut dicompile dan dirun, maka output yang akan muncul yaitu seperti ini

output









Program ini sebenarnya mempunyai beberapa kelemahan, salah satunya yaitu adanya penggunaan statement GOTO. Statement GOTO sangat mudah digunakan, namun ini menghancurkan penulisan struktur program Pascal.

Demikian postingan saya mengenai Program Pascal Kalkulator Sederhana.. Semoga Bermanfaat.