Question: ***Ch. 4 JAVA*** 1. Math.asin(0.5) returns. a. 30 b. Math.toRadians(30) c. Math.PI/ 4 d. Math.PI/ 2 2. What is Math.ceil(3.6)? a. 3.0 b. 3 c.





***Ch. 4 JAVA***
1. Math.asin(0.5) returns. a. 30 b. Math.toRadians(30) c. Math.PI/ 4 d. Math.PI/ 2 2. What is Math.ceil(3.6)? a. 3.0 b. 3 c. 4.0 d. 5.0 3. Which of the following is correct to obtain the min of x,y,z ? a. Math.min (x, Math.min (y,z)) b. Math.min(Math.min(x,y), z) c. Math.min(Math.min(y,z), x) d. Math.min (z, Math.min (x,y)} 4. Which of the following is correct to obtain a random integer between 5 and 10 ? a. 5+ Math.random() 6 b. 5+( int )( Math.random ()6) c. 5+ Math.random ()5 d. 5+( int )( Math.random (05) 5. Which of the following is the correct expression of character 4 ? a. 4 b. n4n c. ' 10004 ' d. ' \00034 6. The Unicode of 'a' is 97. What is the Unicode for ' f '? a. 96 b. 97 c. 98 d. 102 7. Which of the following statement prints smithlexam1|test.txt? a. System.out.println("smith lexam1|test.txt" ); b. System.out.println("smith \ exam1\|test.txt"); c. System.out.println("smith\"exam1\"test.txt"); d. System.out.println("smith "lexam1"|test.txt"); 8. Suppose x is a char variable with a value ' b '. What is the output of the statement System.out.print ln(x+=5) ? a. a b. g c. f d. d 9. Suppose i is an int type variable. Which of the following statements display the character whose Unicode is stored in variable i? a. System.out.println(i); b. System.out.println((char)i); c. System.out.println((int)i); d. System.out.println(i+" "); 10. Will System.out.println((char)52) display 4? a. Yes b. No 11. What is the output of System.out.println('a' - 'z')? a. 25 b. 26 c. a d. z e. 25 12. An int variable can hold. a. ' x ' b. 120 c. 120.0 d. " x " e. "120" 13. Which of the following assignment statements is correct? a. charc= ' d '; b. char c=100; c. char c="d"; d. charc= "100"; 14. ' 3 ' - '2' + 'm' /'n' is a. 0 b. 1 c. 2 d. 3 15. To check whether a char variable ch is an uppercase letter, you write a. (ch >= 'A' \&\& ch >= 'Z') b. (ch>= 'A' &&ch=Ach
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
