Raymond Memorial Higher Secondary School
Raymond Memorial Higher Secondary School
********************************************************
Class – X Total marks- 100
********************************************************
<Candidates are allowed additional 15 minutes for only reading the paper.
They must NOT start writing during this time. >
Answer all the questions from the Section A (compulsory) and four questions
from Section B.
Question no 1. [5x2=10]
x = 1; y = 1;
if(n > 0)
{
x = x + 1;
y = y - 1;
}
What will be the value of x and y, if n assumes a value (i) 1 (ii) 0?
Question no 3. [10x2=20]
ii) Write the return type of the following library functions : [2]
(i) isLetterOrDigit(char)
(ii) replace(char,char)
iii) Give the output of the following program segment:
double x = 2.9, y = 2.5;
System.out.println(Math.min(Math.floor(x), y));
System.out.println(Math.max(Math.ceil(x), y));
v) Rewrite the following program segment using while instead of for statement
int f = 1, i;
for (i = 1; i <= 5; i++) {
f *= i;
System.out.println(f);
}
vi) Analyse the following program segment and determine how many times the loop will be
executed and what will be the output of the program segment ?
int p = 200;
while(true)
{
if (p<100)
break;
p=p-20;
}
System.out.println(p);
vii) Analyse the following program segment and determine how many times tne
loop will be executed and what will be the output of the program segment.
int k=3, i=4;
while (++i<9)
k*=i;
System.out.println(k);
viii) Give the output of the following program segment and also mention the number of times
the loop is executed:
int a,b;
for(a=6,b=4;a<=24;a=a+6)
{
if(a%b==0)
break;
}
System.out.println(a);
Question no 4.
Member methods:
Void accept() – to accept the name of the customer and number of units consumed
A number is said to be special number when the sum of factorial of its digits is
equal to
Question no 6.
Write a program to accept a string. Convert the string to uppercase. Count and output
Sample Input: “SHE WAS FEEDING THE LITTLE RABBIT WITH AN APPLE
Sample Output: 4
Question no 7.
Write a program to input and sort the weight of ten people. Sort and display them in
descending order using the selection sort technique. [15]
Question no 8.
where
(ii) double area(int a, int b, int height) with three integer arguments, returns the area of
a trapezium using the formula:
(iii) double area(double diagonal1, double diagonal2) with two double arguments,
returns
the area of a rhombus using the formula:
Question no 9.
Write a program to take 10 names in a single dimensional array. Display only those
names which begin with a vowel and also ends with a vowel.
***************************************************************************
***************************************************************************