Sunday, October 21, 2018

Lab2

Assalmualaikum, in this entry I will share about what we learn in lab2 which is about problem analysis chart (PAC) and input process output (IPO).
also , we laern how to write , compile, and run a simple java program.

There is some question in this lab that require us to use the scanner because we need to input some variable which is not a constant value. This type of program a little bit confusing and a bit difficult for me to understand at first, but after doing it for some time , I able to understand a little bit how to use the scanner in java.

We need to use this scanner when there is variable that we want to calculate or want to convert something to other thing. for example in this lab, we need to calculate a BMI. Means that there is variable that we need to input to calculate the BMI. The variable is changes and does not constant. Hence, in this case we need to use scanner.

That is all from me for this entry. thank you.

p/s: link to Atika`s blog
ssk3100.blogspot.com

Monday, October 1, 2018

Lab1

Assalamualaikum, so this entry is about my second class of computer programming. in this class we are asked to type the test given, then we have to compile and try to run the program. To compile a program, we have to type 'javac Test1', then if there is some error it cannot be compile, it will pop out our mistake instead. So we have fix the problem until it can be compile. Unfortunately, there is some errors that cannot be fix or solved such as logic error. for example :

image.png

If the question is given like this one, which means that it cannot be solved even by using calculator, so it called logic error. So when we want to run the program, it will turn out like this:

image.png

In the questions given, there is different error or there is no error at all. We as the student need to know where is the error and know how to solve it until the program can be compile. After we solve the problem and can be compile, we have to check weather it can be run or not by typing 'java Test'.

How to solve all the problem is based on the program analysis chart. it is something like this:
Image result for problem analysis chart programming
I find that it is easier to use this method when having programming problem. because when we use this method, we will write it in order. So it is easy to see where is the mistake and easy to fix it.

That is all for this entry. Thank you.


P/S: Link to Atika's blog
ssk3100.blogspot.com