Tuesday, September 25, 2018

PROBLEM SOLVING (Lab 1)

Hi everyone! - This the continuous of my previous post regarding to the lab task. So, I'm gonna share how I start my second week of this course. Last Thursday I was given task on identifying common errors and programming pitfalls,  designing solution to a problem using Problem Analysis Chart and to write, compile and run a simple computer program based on PAC. Basically, this is the main task for this Lab 1 's task. So, three main questions was given to us and we are required  to solve all the problems given.

The main theory we need to apply for this task is Problem Analysis Chart. In order for us to solve all the problems, the first step that must be done is analyze or identify the problem. The function of this Problem Analysis Chart is it can helps you to pull out all the information in the problem and transform it into the table form. From there, you can write down all those things in the java program easily when you can identify the problems clearly. The question one is began with where you need to write down the coding according to the question in the java program. After done write all the coding, the next step is compiling the coding and identify the error. In this case, you need to identify the error precisely and fix the error until you succeed compiling it. After done compiling it, you need to run it in order for you to see the result whether it is same as what you command or not. From my observation, what I can say here, if you can run the program doesn't means that it is 100% correct. Sometimes the result that you get might be not the same as what you command the program to do for you. Total number of test that we need to run is 12 tests and each test has different types of error. From my point of view, after done all the 12 tests, it makes  me become more familiar with the errors and I can identify the given coding whether it has error or not easily. Practice makes perfect. Below is the solution for Question 1:

Let's Begin!!!


Test1

Below is the coding for test 1. What I need to do is typing all the coding in the windows prompt and compile by using java program. After done all the steps, i found that there is an error in the coding. For example, there is missing word of "static" in the middle of "public" and "void" in the sentences.

 


After I fix the error, here is the right coding for above test.



I repeated the same way for all test.

Test2

Answer:




Test3

Answer:





Test4
Answer:



Test5

Answer:





Test6

Answer:




Test7

Answer:




Test8
Answer:




Test9
Answer:





CelsiusToFahrenheit

 

Answer:




Welcome









Answer:







After that, the second question is about to analyse the problems by using Problem Analysis Chart. There are about 3 sub-question with around 2 to 3 sentences and what I need to do is read the sentences carefully, identify the problem and write down in Problem Analysis Chart. This part is quite easy but the way to write down in Program Analysis Chart is important so that other people can easy to understand the message we are trying to convey without feeling confuse. Below is the solution for Question 2:


Data
Processing
Output
Acre of land in square feet.
Calculate number of acres  in a tract of a land.
Total acres for a land with 389,767 square feet.


Data
Processing
Output
Test scores
Calculate average test scores.
Average of three test scores.


Data
Processing
Output
Percentage of profit.
Calculate retail price of a circuit board

Calculate the amount of profit earned for that product.
The retail price of a circuit board.

The amount of profit earned for that product.



The third question is little bit combination of first and second question. This question required me to identify the problem first by using Problem Analysis Chart (PAC) and after that write down the coding in the notepad and compile and run the coding by using java program.
Data
Processing
Output
Airplane’s length for take-off speed.

Airplane’s acceleration.
Calculate runway length needed for an airplane to take off
Length for an airplane to take off.





This task has strengthen my knowledge in identifying the errors, identify the problems and create the coding based on the given problem by my own self. It is very useful!

Nursaidatul Sakinah Binti Saharuddin
184881




Enjoy reading my blog!
Feel free to share any fruitful knowledge with me as I am eager to learn something new and we can learn together!

Thank you :)

This is my friend's blog. Check him out!
hongjing96.blogspot.com (lLim Hong Jing )

Wednesday, September 19, 2018

Entering New World of Programming


Assalamualaikum and hi Guys! This is my first post of reflection for all lab task. I would like to share my new experience taking this course. 

I am an economic student but taking this computer programming course is a compulsory for my curriculum. This is first time I learn about computer programming but I take it as a challenges to myself. 

Today, I learn new fruitful knowledge that I had never learn or know before this. It is About "Windows Command Prompt". I learned how to create simple Java Program by using this command Prompt. It's not really difficult to create it but you must have high degree of patience and do it precisely. The picture below portrays the steps to create the Java Program. Honestly, I'm trying more than five attempts to create it until I succeed make it appear. Many things you need to pay attention until to the trivial matter. Before I succeeded print the "Hello World", there are many mistake I did until I got error many times. One of the simple mistakes I did was I forgot to set the java to be available everywhere in the computer. After done setting the java file, I forgot to close and open back the "cmd". I just proceed compile the  Java Program and what I get is again ERROR!. So the lesson here I learned was whenever I make change in the computer, I need to close the "cmd" first and open it again. 

Besides, if I want to run this program, I need to make sure that the java file is available in my computer. Apart from that I learned the command in the windows prompt for example, to create new folder is by typing "mkdir <folder name>", to go to the directory is by typing "cd <folder name>", to go to the parent directory is by typing "cd.." and to see the list of all file in the folder is by typing "dir". Not only that, in order to strength our knowledge, we need to share our knowledge with others. This is what I did where after I succeed run the program, I teach my friends how to do it.On the other hand, also this is my first time I use blog where my lecturer ask us to create blog to post all our reflection pertaining to the lab task. From my point of view, this is a good thing where students can learn new thing apart from their lecture and this blog can be one of the medium for learning session.Last but not least, practices make perfect and we need to learn from mistake.



Nursaidatul Sakinah Binti Saharuddin
184881

Next blog: hongjing96.blogspot.com (lLim Hong Jing )







Problem Solving (Lab6)

Assalamualaikum and hi guys ! Here I come back to share new problems with new solution. Honestly, I do not really understand with questions...