Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Q1. Which of the following conditions tests for the user to enter the string \"H

ID: 3670916 • Letter: Q

Question

Q1. Which of the following conditions tests for the user to enter the string "Hello"?     [2 Points]

a) if (s == "Hello")

b) if (s.substring(0,5) == "Hello")

c) if (s.equals("Hello"))

d) if (s = "Hello")

------------------------------------------------------

Q4: Write java program to read 3 integers and print out the largest and the smallest integer: [4 Points]

Q5: Write java program to read two words then compare them. [6 Points]

If they are equal to each other:

Print out this text “You entered the same word twice

Print out the number of characters in the word.

Otherwise:

Print out this text “You entered two different words

Print out the first words with uppercase letters and the second word with lowercase letters.

Explanation / Answer

Q1)

c) if (s.equals("Hello"))

Q2)

Q3)

  System.out.println(s1.toUpperCase());

System.out.println(s2.toLowerCase());

}