Friday, October 12, 2018

REFLECTION OF LAB3

Hello Everyone here I am today to write a reflection about my third lab assignment which was quite challenging compared to my previous lab assignments. Things getting harder as we need to learn more deeply about the java program and obviously its getting more interesting and scary as well :').

There were eight questions given in this assignment. Question one until four I was able to do cause we just need to trace the programs and show their output. I didn't found that hard because i have done that before in my previous assignment. Questions five till eight I found them really hard where we need to write a program for each situation given.


Question 5 

For this question we need to write a program that prompts the user to enter a letter in the alphabets. Later on, the program will display the letters before and after of the specified letter. We were given letter 'g' in the sample run. Here I have applied the "char" data type which represents a single character thought by our beloved lecturer Dr.Erzam. As usual I have encountered some errors throughout coding the program which I have misplaced the quotation marks but eventually I managed to correct it :).


Question 6 


 This question is more to calculating distance using (x1, x2, y1 and y2). I have used double data type which are math.pow and math.sqrt to solve this question. Actually by using various types of data for each question helps me to answer and learn more on how to identify each data type.


Question 7

Since I am a slow learner I found this question abit hard for me. Just took sometime to understand what it really wants. We need to prompt the user to enter 0 to convert from USD to RM and 1 to convert from RM to USD. Again prompt the user to enter the amount in USD or RM to convert it to USD or RM respectively. With the guidance of lecturer and my friends I could able to type the coding to run the program. A very big thanks to them :)


Question 8

Question one was the most challenging question for me. The program prompts the user to enter a number 0, 1 or 2 and displays a message indicating whether the user or the computer wins, loses or draws. 0, 1, and 2 represent rock, paper and scissor respectively.

So that's the end of this week's lab assignment. Even though I successfully completed running the program I still need many more practices on this so that I could manage to do it on my own for the next time. This kind of challenging questions actually helping me to explore the possibilities of my mind and no matter what I will keep trying and could able to find a way to solve it at last.

That's all for today peeps. Have a Nice Day Ahead.

Muchas Graciasss :) !!!

Pritah D/O Subramaniam (185797)

Next blog : yanhua0112.blogspot.com

Wednesday, October 3, 2018

REFLECTION OF LAB2

Hello everyone, Good Day :) Hope you all doing good there. Here today I am to tell about my experience of Lab2 which I did last week 27th of September. This third assignment is the continuous of problem solving chapter.

Alright coming to the first question I need to trace each and every program and to show their output. There were four classes given and I managed to run all of them without tracing any error. I could able to spot error in classes of question 1. In sequence, I was able to write a program that declares  variables and assign values from a user for each data type available in Java.

There were eight types of data which are long, short, double, byte, boolean, integer, char and float. By doing so this helps me with getting a better understanding. Without practicing there will be many lost opportunities that will have to be faced, due to the lack of determination. That is why I believe that practice makes perfect.
 
 Furthermore, question 5 and 6 thought me on how to do Input Process Output (IPO), Problem Analysis Chart (PAC) and algorithm for the program. IPO is used to analyze problems and develop algorithms. Besides, it is also used to organize and summarize the results of a Problem Analysis.

 In a nutshell, I would like to say that still more practices I need to do on this and definitely practice makes things possible. It could help me to master this programming in future. That is all from me for this week.

THANK YOU ;) !!!

Pritah D/O Subramaniam (185797)

Next blog :   yanhua0112.blogspot.com

Wednesday, September 26, 2018

Reflection of Lab1


Greetings everyone :)... Here comes my second lab assignment of SKK3100 Computer Programming 1 which is Lab1. It is entitled "Problem Solving". In this assignment first question was given 11 classes and it need to be written in separate Java files. In the end, I will need to compile, identify and fix the errors in each of the classes correctly.

Firstly, it was really hard for me to fix the errors and it took almost one hour for me because it was keep showing there are some errors and errors in the first test. I really gone mad and started to continue with second test and third test respectively. Unfortunately, the following tests also keep showing that there are some errors.


Later on, with the help of my lecturer I could able to find out the exact problem. It seems I need to save the test like for an example: Test1.java, but I failed to do so and that was the main cause of error in my first test. I saved the file with wrong name so that it couldn't be detected. I was really shocked and surprised how a little silly mistake could be effected and I managed to change the file name exactly how it was stated. Often times, our failures teach us valuable lessons that we only gained because of the experience we gathered after messing up. It’s obvious that the mistake I made taught me a very useful lesson that day.

Coming for the second question there were three situation given. I need to design a solution in order to solve a problem using PAC. I was able to analyze problem in each situation successfully. There will be three main things to be written in PAC table contained three columns which are data, process and output.

Last question is quite challenging because we need to do PAC table then need to type the solution in the notepad. Once done typing we can check the answer in command prompt. And I can happily say that finally I could learn something new and useful for the week. Once again I would like to thank my lecturer Dr.Erzam. That is all for this week, thank you :) !!!

PRITAH D/O SUBRAMANIAM (185797)
Next blog :  yanhua0112.blogspot.com
 

Wednesday, September 19, 2018



Last week 13th Thursday, was our first class of Computer Programming 1. We had 2 hours of lecture and 1 hour of lab time and we were introduced to the basic components of the computer.
After done with the lecture we were taught to open command prompt which is “CDM” in computer and also created a new folder there. 'CD' is to check a particular file on the computer while 'DIR' is where I can check out what is inside the folder. It was quite hard for me to understand at first but then I managed to understand the steps with the help of my lecturer and friends.





     Here comes the main part of this assignment which is creating a folder using my name :D. I created a folder by typing "mkdir [MYNAME]". Following that, inside the folder, I have created "Lab0" folder and saved a notepad.

























   According to the second question we need to open up a java compiler in command prompt. Unfortunately it couldn't be found and I need to recheck and finally, I found javac file was in the 'bin' folder. I made some adjustments in order to run java with the help of my lecturer. I specified the full path in the control panel ⇒advanced system settings ⇒edit variables ⇒edit path then copied the address location of the Java bin folder with a semicolon at the end. Finally, it was successful running the compiler by commanding 'javac' on CMD.




     Once done with that, I have created a simple Java program on notepad using the code which was given in the assignment and also named that file as "MyFirstJavaProgram.java".



     The last step was I typed javac MyFirstJavaProgram.java on CMD and finally, it is ready to run the compiler and successfully done. I am very happy to be informed that I have learned many new things although I have faced many challenges throughout this process and many more thanks to my lecturer and friends.

THANK YOU... :)

Pritah D/O Subramaniam (185797)

Next Blog : yanhua0112.blogspot.com