Question: (7*3 = 21 points) Q2. Answer the following questions: java Given: char value1 = '9', value2 = 'Y, value3 =', value4 = '*'; 1. Write

 (7*3 = 21 points) Q2. Answer the following questions: java Given:

(7*3 = 21 points) Q2. Answer the following questions: java Given: char value1 = '9', value2 = 'Y, value3 =', value4 = '*'; 1. Write an expression that checks and prints if value is digit or not? output: 2. Write an expression that checks and prints if value3 is digit or not? output: 3. Write an expression that checks and prints if value2 is a letter or not? output: 4. Write an expression that checks and prints if value is digit or letter? output: 5. Write an expression that checks and prints if value4 is digit or letter? output: 6. Write an expression that checks and prints if value2 is lower-case letter or not? output: 7. Write an expression to change value2 to lower-case letter? output: Q2. For each of the following program, show the output. (4 x 8 = 32 points) 1. String s1 = "pankaj"; String s2 ="PANKAJ"; System.out.println(s1 = s2); 2. String s1 = "abc"; String s2 = "abc"; System.out.println(s1 == s2); 3. String string1 = "Geeksforgeeks", string2 = "Practice", string3 = "geeks", string 4 = "Geeks"; System.out.println(string3 + " is equal to " + string4 + ":" + string3.equals( string4)); System.out.println(string3 + " is equal to " + string4 + ":" + string3.equalsignoreCase( string4)); System.out.println(string1 + "compared to " + string2+ ":" + string1.CompareTo( string2)); System.out.println(string2 + " compared to " + string1 + ":" + string2.CompareTo( string1)); 4. char c='a', c2='1'; int a=c, b=c2, x= 33; System.out.println("The ASCII code of "+ C + "is" + a); System.out.println("The ASCII code of "+c2 + "is" +b); System.out.printf("%d is the ASCII code of %c ", x,x)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!