Friday 14 December 2018

LAB 4

Welcome to my blog :)

This is time i learnt about Multi-way and nested selections !
I learnt to use multi-way and nested selection statement to specify alternative paths of program's execution. Before this, i have learned one way if statement and this time i can do two way if statement. In this two way if statement, it could be another statements for true case in one problem. This two way statement allow us to create multiple choice or decisions.

In order to apply this two way if statement, we have been asked to create our own game. ouh yeahhh it is interesting. i have created my own story which i clearly can see the function of this two-way if statement. hiks :)

LAB 3

Dinie is here !

So do you know what topic it is for Lab 3?
The topics are problem solving, data types and selection.

So what is data types? i have mentioned in previous post that the example of data types are Byte, Long, String and others. Let me share the information one of data types. So we know that number consists of integer, decimal, whole number and number also have minimum value maximum value. To create a program we have to make sure what kind of variable that we have. If the variable is an integer the data type is byte, if the variable is decimal the data type is double. You have to identify the variable to know the data type. This is basically the basic/primitive data type.

As usual, in this lab i trace the program given. This time is different as we are using different data type and we need to make sure the program is using the correct data type. Then i need to correct if the data type is wrong.

This time, the question for creating a program for the problem is quite difficult. This is beacuse the problem given quite difficult. I took a longer time than before as i need to learn more about the terms terms such as data types, relational and comparison operators to test some kind of relations between two entities such as ==, -= and etc. This kind of comparison operators is used in certain kind of program.

During lab 3, i have learnt to declare, initialize and use appropriate data types in program. To specify alternative paths of program's execution i have to use selection statement. Then after knowing and master all of this i have to write and practice more to run this simple computer program. Exercise in this lab manual is verry helpful !

LAB 2

Holla Holli Hullu !

Hi guys, i'm going to share what i have learnt during lab 2. this is the very late post to do my reflection and sorry for that. This is because i keep doing my coding and forgot to do the reflection. Sorry Dr Erzam :)) hihihihihi

So the topic for lab2 is problem solving. At the end of this lab, all of us should be able to trace a program and designing solution to a problem using PAC and IPO. From the previous post i have shared what is PAC. For IPO it is stand for Input Process Output Chart. IPO is almost likely to PAC. It only have a little bit different as IPO is more details than PAC. In PAC we just analyse the problem generally while IPO we put all the details in each input, process and output. So for those who wants to know or and learn more about this you can straightly google it and you can see the difference. after learning IPO, i should be able to write, compile and run a simple computer programme based on IPO.

Here we go !
This lab consists 6 questions. For the first question, we have to trace the programme and show their ouput. I need a Trace Program Table to trace the program given. To trace the program, we have to through line by line. Write a line that contain value and show the output.

After tracing each program, i need to identify the error in the program. This is where we can find the error and correct it. While tracing the program, we will know each error and the error can be logic error.

For the next questions i have to be able analyse the probem given using PAC and IPO. I need to the PAC and continue for IPO. IPO we refer to the PAC and come out with all the details. Then, i have to create Java program and run. I want to say that this method is really helping me in designing solution for the problem.

There is also a program that using different variables according to the input. The variables i mentioned is the data type such as Byte, Long, Double and others.

so lets move to the next lab.



LAB 1

Ouh hye, Dinie is back. Last Tuesday on 25th September, we proceed to next lab. This time the topic is about problem solving. After getting used with programming environment, we need to be able to identify common errors and programming pitfalls. Means that we were given all the coding and need to follow the programs but there are some errors inside the coding and we need to identify and fix by ourselves. So, at the first I just try the wrong coding that given and found out that the Java cannot run the program even there is only one error. To make it clear lets go through all the tests one by one.

Test 1

Test 2

Test 3

Test4
Test5

these are some of examples that we try to fix the errors. By doing this, we know the errors we shoud avoid while doing the coding. This is important to make sure the programme we create is running and success. 

For the question 2, we have to analyze the problem using PAC. PAC is stand for Problem Analysing Chart. This PAC is helpful as it help a lots in jotting down all the requirements needed to do coding. It organised our process while creating the program. In PAC, we need to list out the data, processing and the output. By referring the PAC, we can proceed to do the flowchart and coding.

So we applied the PAC in question 3. We need to choose one of the problem given and used the complete Java program to solve it. While doing this question, it makes me know what is the input that i need to know and what is the process of the program so that the output is print out succesfully.

In this lab, i need to improve and do more practice so that i can easily creating Java program to solve any problems !


LAB5

hallo ! i'm back for the reflection of lab5 :) so, the topic for lab5 in week 6 is switch statement, logical operators and conditional...