Cl. 10_pre Board_computer Applications (Set-A)
Cl. 10_pre Board_computer Applications (Set-A)
SESSION: 2023-2024
PRE BOARD EXAMINATION
2
(xviii) What will happen if the test condition given in the outer loop evaluates to false?
(a) Inner loop will execute (b) neither inner nor outer loop will execute
(c) outer loop will execute (d) outer loop will not execute, inner loop will execute
(xix) Which type of error occurs in the following statement:
System.out.println(Math.pow(0,-1));
(a) runtime error (b) logical error (c) syntax error (d) no error
(xx) The array double x[10] occupies:
(a) 40 bytes (b) 80 bytes (c) 20 bytes (d) 10 bytes
Question 2: [2x10=20]
(i) Evaluate:
(a) Character.isUpperCase(Character.toLowerCase(‘A’));
(b) System.out.println(“RocKet”.substring(2) + “rock”.replace(‘t’, ‘I’));
(ii) Predict the output:-
if(Math.ceil(2.5) > Math.abs(-6.5))
System.out.println(Math.floor(4.5)+5);
else System.out.println(Math.max(4.5,-5));
Question 3 [15]
A bank announces new rates for Term Deposit Schemes for their customers and Senior Citizens as
given below:
Term Rate of Interest (General) Rate of Interest (Senior Citizen)
Question 4 [15]
Write a program to accept a number and arrange the digits of the number in descending order.
Example: Sample Input: 486290
Sample Output: 986420
Question 5 [15]
Write a program to accept a string and check if it makes a strong password. A strong password
should have at least 8 characters with one uppercase character, one lowercase character, one digit
and one special character.
4
Question 6 [15]
A double dimensional array is defined as N[4][4] to store numbers. Write a program to find the sum
of all even numbers and product of all odd numbers of the elements stored in Double Dimensional
Array (DDA).
Sample Input:
1057
3926
5493
4341
Sample Output:
Sum of all even numbers: 20
Product of all odd numbers: 46
Question 7 [15]
Design a class overloading a method calculate( ) as follows:
1. void calculate(int m, char ch) with one integer argument and one character argument. It checks
whether the integer argument is divisible by 7 or not, if ch is 's', otherwise, it checks whether the
last digit of the integer argument is 7 or not.
2. void calculate(int a, int b, char ch) with two integer arguments and one character argument. It
displays the greater of integer arguments if ch is 'g' otherwise, it displays the smaller of integer
arguments.
3. void calculate(String str, int p) with one String argument and one integer argument. It displays
all the uppercase characters if 'p' is 1 (one) otherwise, it displays all the lowercase characters.
Question 8 [15]
The annual examination result of 50 students in a class is tabulated in a Single Dimensional Array
(SDA) is as follows: