Class 10 Key
Class 10 Key
Assertion (A): It can be used as a delay counter in which the loop executes for a predefined
number of times.
Reason (R): A Null loop is a loop that does not contain any instructions within itself.
A. Both A and R are true and R is the correct explanation for A.
2. The below is the picture given will be a perfect example of
D. Abstraction
vii.
−b+ √ b 2−4 ac
write the java expression for the given quadratic equation.
2a
X= (-b + Math.sqrt(Math.pow(b,2) – 4.0*a*c))/(2.0*a);
viii. class conv_energy {
static double PE (int m, int g, int h) {
return (m*g*h);
}
static double KE (double m, double v) {
return (0.5 *m*v*v); //enter the necessary formula for kinetic energy
}
public static void main (String args[]){
double x = PE(_any_,10,_any_); // fill in appropriate numbers g=10 has been substituted
double y = KE(10,5);
_double__ conv= x +y; // correct the statement and rewrite accordingly.
System.out.println(“Law of conservation of energy derived=” + ____conv__);
}}
ix. 1. ___Wrapper classes___are used to convert various primitive data types values to the
required data
types.
2. A ___Primitive__ data type can be encapsulated within an object using wrapper class.
3. The name of a wrapper class begins with a _____Uppercase letter____
4. Wrapper class are present in_____java.util______
Qurstion 3
Define a class to accept a number and output whether it is a Palindrome or not. Define a class with the
following specifications:
Class name: