Advertisements
Advertisements
Write the return type of the following library functions:
- isLetterOrDigit(char)
- replace(char, char)
Concept: Introduction of Mathematical Library Methods
Give the output of the following :
(i) Math.floor (- 4.7)
(ii) Math.ceil(3.4) + Math.pow(2,3)
Concept: Introduction of Mathematical Library Methods
Name the mathematical function which is used to find sine of an angle given in radians.
Concept: Introduction of Mathematical Library Methods
Name a string function which removes the blank spaces provided in the prefix and suffix of a string.
Concept: Introduction of Mathematical Library Methods
What value will Math.sqrt (Math.ceil (15.3)) return?
Concept: Introduction of Mathematical Library Methods
What is the output of Math.ceil(5.4) + Math.ceil(4.5)?
Concept: Introduction of Mathematical Library Methods
Which of the following mathematical methods returns only an integer?
Concept: Introduction of Mathematical Library Methods
Write Java expression for:
`(|a + b|)/(sqrt(a^2 + b^2))`
Concept: Methods of Math Class
Write the java expression for `root3x + sqrty`
Concept: Introduction of Mathematical Library Methods
The absence of which statement leads to fall through situation in switch case statement?
Concept: Introduction of Conditional Statements in Java
Consider the following program segment and select the output of the same when n = 10:
switch(n)
{Case 10: System.out.println(0*2);
case 4: System.out.println(n*4); break;
default : Syslem.out.println(n);
}
Concept: Introduction of Conditional Statements in Java
Rewrite the following code using the if-else statement:
int m = 400;
double cl). = (m>300) ? (m/10.0) * 2; (m/20.0) - 2;
Concept: Introduction of Conditional Statements in Java
Give the output of the following program segment:
int n = 4279; int d;
while(n>0)
(d=n%10;
System.out.println(d);
n=n/100;
}
Concept: Introduction of Conditional Statements in Java
Which of the following data type cannot be used with switch case construct?
Concept: Introduction of Conditional Statements in Java
Which of the following is not true with regards to a switch statement?
Concept: Introduction of Conditional Statements in Java
Rewrite the following code using single if statement.
if(code=='g')
System.out.println("GREEN");
else if(code=='G')
System.out.println("GREEN");
Concept: Introduction of Conditional Statements in Java
A student executes the following program segment and gets an error. Identify the statement which has an error, correct the same to get the output as WIN.
boolean x=true;
switch(x)
{ case 1:System.out.println("WIN");break;
case 2;System.out.println("LOOSE");
}
Concept: Introduction of Conditional Statements in Java
Using the switch-case statement, write a menu driven program to do the following :
(a) To generate and print Letters from A to Z and their Unicode Letters Unicode
(b) Display the following pattern using iteration (looping) statement: 1
Concept: Introduction of Iterative Constructs in Java
Write two separate programs to generate the following patterns using iteration (loop) statement:
(a)
Concept: Introduction of Iterative Constructs in Java
Write two separate programs to generate the following patterns using iteration (loop) statement:
(b)
Concept: Introduction of Iterative Constructs in Java