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


No comments:

Post a Comment