Friday, December 21, 2018

REFLECTION ON LAB 10

Hello people glad to tell you guys that this will be my last lab assignment which is lab assignment 10. It contained 4 questions and the topic is on Array. At the end of this lab I could able to define, declare and process array. Besides, I can also able to solve problem using array.

This week's lab was really really hard and it took a long time to settle down. At last I managed to do with the help of my tutor and fellow friends successfully. Here goes the working for the questions that really took time for me to settle down.

First question I need to write a program that uses a String array to hold the five students’ names, an array of five characters to hold five students’ letter grades, and five arrays of four doubles each to hold each student’s set of test scores. The program should have methods that return a specific students’ name, average test score, and a letter grade based on the average. It was really hard for me to settle this question and luckily I managed to do.





Furthermore, I found the second also abit hard . But at least I have completed finally.


Alright that is all from me guys. Than you so much for reading my blog .. Take care dear all till we meet again ❤❤❤...


Pritah D/O Subramaniam (185797)


Next blog : yanhua0112.blogspot.com 

Sunday, December 16, 2018

REFLECTION ON LAB9

Greetings, lovely people ❤❣❤ !! Today I'm here to talk about our lab 9 assignment topic on Single-Dimensional Array. At the end of this lab I should be able to declare, create, initialize and process single-dimensional array. Besides, I also could to program common array operations and also could able to apply array in application development.

This week lab contained 9 questions. First question, was given to write statement for seven sub questions. For the second question I need to identify and fix errors for the following code given which attempts to assign random numbers to an array of 100 integers. I found question number 1 and 2 were not that hard, I could still managed to do.

Starts the challenges from the third question onward. I need to write program that reads in 'n' integers and sort them in increasing order.



Furthermore, fourth question I need to write a program that randomly generates 'n' integers between 0 and 10 and counts the occurrence of each. 



For the fifth question, I need to write a program that reads an unspecified number of scores and determines how many scores are above or equal to the average, and how many scores are below the average. Enter a negative number to signify the end of the input. Assume maximum score is 100. 



Question 6



Answer :




In question 7, I must write a test program that prompts the user to enter ten numbers, invokes this method to return the maximum value, and displays the maximum value. 



In question 8 a program need to be written to prompt the user to enter the number of students, the students’ names, and their scores and prints student names in decreasing order of their scores. Assume the name is a string without spaces, use the Scanner’s next() method to read a name.

That is all for this week guys. Take care till we meet again☺.

THANK YOU FOR READING !!!

Pritah D/O Subramaniam (185797)


Next blog : yanhua0112.blogspot.com 

Friday, December 7, 2018

REFLECTION OF 29-11-2018

Hello dear people, its me again meeting you guys. As always hope you guys doing really really well there !! This week's lab is about "Methods". A method is a collection of statements that are grouped together to perform an operation. We could able to do three main things at the end of this lab which are to define and invoke various types of methods, to develop reusable code that modular, easy to read, easy to debug and easy to maintain and the last one to apply the concept of method abstraction and step-wise refinement in software development.

In this week class we have been thought about the subtopic of "overloading" by our lecturer Dr.Erzam. Firstly, let me explain what I have understand from the above topic. Method overloading is a feature that allows a class to have more than one method having the same name, if their argument lists are different. It is similar to constructor overloading in Java, that allows a class to have more than one constructor having different argument lists.

There are three types of method overloading:
  1. Number of parameters
  2. Data type of parameters
  3. Sequence of data type of parameter
We have been given 5 questions for this lab and I'll share with you guys the questions and answers once I have completed it. That's all from me for this week guys, have a happy weekend! Take care ❤❣❤

THANK YOU FOR READING !!!


Pritah D/O Subramaniam (185797)


Next blog : yanhua0112.blogspot.com 

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