Class 10 100 Marks Question
Class 10 100 Marks Question
GROUP A: 40 Marks
4. Write the memory capacity (storage size) of short and float data type in bytes.
5. Identify and name the following tokens:
1. public
2. 'a'
3. ==
4. { }
int a = Integer.parseInt(P);
int b = Integer.valueOf(Q);
System.out.println(a+""+b);
char ch = '9';
res= Character.isDigit(ch);
10. What is the difference between the linear search and the binary search technique?
11. Write a Java expression for the following:
|x2 + 2xy|
12. Write the return data type of the following functions:
1. startsWith()
2. random()
13. If the value of basic=1500, what will be the value of tax after the following statement is
executed?
tax = basic > 1200 ? 200 :100;
14. Give the output of following code and mention how many
times the loop will execute?
int i;
if(i%2 == 1)
continue;
System.out.print(i+" ");
}
15. State a difference between call by value and call by
reference.
16. Give the output of the following:
Math.sqrt(Math.max(9,16))
17. Write the output for the following:
System.out.println(s1.substring(0).concat(s2.substring(
2)));
System.out.println(s2.toUpperCase());
18. Evaluate the following expression if the value of x=2,
y=3 and z=1.
1. System.out.println(x[3]);
2. System.out.println(x.length);
Member methods:
ShowRoom() — default constructor to initialize data members
void input() — To input customer name, mobile number, cost
void calculate() — To calculate discount on the cost of purchased items, based on following criteria
void display() — To display customer name, mobile number, amount to be paid after discount.
Write a main method to create an object of the class and call the above member methods.
2. Using the switch-case statement, write a menu driven program to do the following:
Letters Unicode
A 65
B 66
. .
. .
. .
Z 90
(b) Display the following pattern using iteration (looping) statement:
1
12
123
1234
12345
3. Write a program to input 15 integer elements in an array and sort them in ascending order using
the bubble sort technique.
(a) void series (int x, int n) – To display the sum of the series given below:
x1 + x2 + x3 + .......... xn terms
(c) void series () – To display the sum of the series given below:
5. Write a program to input a sentence and convert it into uppercase and count and display the
total number of words starting with a letter 'A'.
Example:
6. A tech number has even number of digits. If the number is split in two equal halves, then the
square of sum of these halves is equal to the number itself. Write a program to generate and print
all four digits tech numbers.
Example: