Friday, November 23, 2018

REFLECTION OF LAB7


Hello people☺!!! Its a pleasure to meet you all after a very long break. How have things been going ? Hope you guys doing really really good over there. Alright guys its time to back to our weekly routine to discuss about the Lab Assignment 7, whoooaa... This time we have learned about Loops.

There are many categories of loops such as while loops, for loops, do-while loops and also nested loops. For you guys to more understand loops is a instruction that is continuously repeated till it reach a certain condition. This week's lab contain 10 questions which need to be solved. Starting from first question we need to just show output for given code. I found that easy so there is no complaint about it :D. Second question need to trace the program by showing the values for each variable and write the output. Question 3 and 4 is simple cause its just about the loop writing for given code.

Question 5 is quite tricky cause it was divided into two that must convert given code for loop statement to a while and do-while loop.





After this I found question 9 was difficult. As usual I stucked here but managed to complete it with the guidance of my friends. This question I need to write a program that plays the popular rock-paper-scissor game. Actually the coding was quite lengthy that's why it was really tough for me. Luckily I've completed to run the program at last...☺☺



Finally the last tenth question also took sometime to solve it. I need to find the minimum point on the function f(x) = ( x – 2 ) 2 + 1 where x = [-1, 0, … , 4] using random optimization.



So yeah that is all for this week my dear friends. Even though things getting harder still I could manage to do my assignment with the guidance of my friends and my lecturer. You know self belief and hard work always earn you success. Till we meet next week with the new Lab assignment questions , take care..❤❤❤


THANK YOU FOR READING !!!

Pritah D/O Subramaniam (185797)




Next blog yanhua0112.blogspot.com

Friday, November 2, 2018

REFLECTION OF LAB 6


Good day people here I'm today to talk about my Lab assignment 6. Pheww...things are getting really harder man 😢. This week's topic is about Character and String. End of this lab we should able to Read strings and characters from the console. Furthermore, we also should able to declare and manipulate strings and character using methods provided by Character and String class. I would like to give a brief explanation about our today’s topic. 

“Char"
  1. One character
  2. Primitive type
  3. Notes the single quotes
  4. UTF-16 character 
  1. Zero or more characters
  2. A class
  3. Notes the doubles quotes 
  4. Can be thought as an array of chars
       
There were six questions given in this assignment. The first and second question was easy because the “System.out.println” was given and I just need to write complete java code to show the output. The third question, I should write an application that uses String method compareTo to compare two strings input by the user. Output should show whether the first string is less than, equal to or greater than the second.         
            
The fourth question need to write a program that displays a random lowercase letter using the Math.random() method.




The fifth question is to write a program that receives a character and displays its ASCII code (an integer between 1 and 127).



As usual the last question was a bit challenging for me where I need to write a program that prompts the user to enter a password and displays Valid Password if the rules are followed or Invalid Password otherwise.



That's the end guys .. Hope you all enjoy reading it. Till we meet again next week take care 💌.


THANK YOU FOR READING !!!

Pritah D/O Subramaniam (185797)


Next blog yanhua0112.blogspot.com


Tuesday, October 23, 2018

REFLECTION OF LAB 5

Hello peeps, feel great to meet you guys after one week and can be said it was a hectic week for me because I was having my mid-term tests 🤣 ... I'm feeling better now because the pressure is off and happy to inform you guys that next week will be our mid semester break.. I am gonna back to my home, yeayhhhh 😃! Alright without any delay I would like to tell my experience about this week's lab assignment entitled Switch statement, Logical Operators and Conditional Operator.

I was taught in the previous class on this topic and it was still fresh on my mind. Listening in lectures are the main way of communicating knowledge in the classroom setting, so being able to listen well is an essential to success in one’s education. There are many different techniques that once practiced and mastered, can lead to success. There were 9 questions given in lab assignment 5 and I was able to complete till question 7 cause it wasn't that hard to solve.

I found question 8 & 9 were a bit tough and also tricky which I need to really really understand what is asked in the question. For question 8 I need to read in three numbers from the console and output if the number are sorted or not using if-else statement and using conditional operator. Luckily Ms.Husna my tutor helped me in solving this question and she gave a brief explanation on how to solve it so that it was easy for me to understand and work on.


IF



CONDITION





Question 9 is which I need to write a program to compute the personal income tax. This question also was guided by my tutor so that I have successfully completed and run the program. 



So yeah that's it i have completed all the 9 questions successfully and this time I didn't find this much hard to complete the assignment because only 2 questions were tricky. Actually saying the more you practice the more you become better. The more I do exercise helps me to understand more about programming. Till I meet you guys next week with new topic and exercises take care 💞💞💞.


THANK YOU FOR READING !!!

Pritah D/O Subramaniam (185797)


Next blog yanhua0112.blogspot.com


 


Wednesday, October 17, 2018

REFLECTION OF LAB 4

Hello people glad to meet you all after one week and hope you guys doing really really well there ;) ! I'm really having a hectic week cause my midterm tests are around the corner but still I'm here for you guys to update my blog about my latest assignment which is Lab4. Today I'm going to tell you guys about Multi-way and nested selections.

In this week's assignment we need to write our own text adventure game. Text adventure game tells story through passage of a text revealed to a player in response to typed instructions. In this task we need to write a program to get the user's instruction and implement at least ten rooms to explore and two ways for the game to end. 

To be honest I found this really hard to complete where I couldn't understand how to implement and also don't know how to start. Almost all my friends can't able to find a solution for this question. I started to loiter around looking for the answers :D... I just wasted almost three hours in lab and this is the first time I couldn't move a single step. But finally after the class I managed to get some examples from internet and it was easy for me to start up the question.

I created a thriller and interesting story for the game. I started to type the codes and was checking for the errors. At last I have successfully completed the game. A bundle of thanks to my dear friends who helped me a lot to solve this question. That's all for today.


THANK YOU :) !!!

Pritah D/O Subramaniam (185797)

Next blog yanhua0112.blogspot.com

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