Mock 6
Mock 6
MARKS :100
Answers to this paper must be written on the paper provided separately.
You will not be allowed to write during the first 15 minutes.
This time is to be spent in reading the question paper.
The time given at the head of this paper is the time allowed for writing the answers.
This Paper is divided in to two sections.
Attempt all questions from Section A and any four questions from Section B.
Section A - 40 marks
[Attempt all questions]
Question 1:
Question 2:
b) Write a java statement to compare two strings (m[i] and m[j]) in a single dimensional array [2]
Question 3:
Question 4: [15]
The Bank sanctions ‘Housing loan ‘ to the employees belonging to HIG group, MIG group or LIG
group according to their yearly income:
LIG: Lower Income Group
MIG : Middle Income Group
HIG : High Income Group
Question 5: [15]
Write a menu driven program to accept a number and check whether it is a twisted prime or
Disarium number.
A prime number is said to be ‘Twisted Prime’, if the new number obtained after
reversing the digits is also a prime number.
Sample Input : 167
Sample Output : 761. So 167 is a twisted prime number.
A number will be called DISARIUM if sum of its digits powered with their respective
position is equal with the number itself.
Sample Input: 135
Output : It is a DISARIUM
(Workings 11+32+52 = 135, some other DISARIUM are 89, 175, 518 etc)
Question 6: [15]
A non-palindrome word can be made a palindrome word by just adding reverse of the word
aith the original word . Write a program to accept a non-palindrome word and display the
new word after making it a palindrome
Sample input : ICSE
Sample output : ICSEESCI
Question 7: [15]
Question 8:
i) void compute (int, char) : to compute square of integer argument if character argument
is ‘s’ otherwise finds its cube.
ii) void compute (double, char): to compute volume of cube if character argument is ‘v’
iii) void compute (int, int, char) : to compute area of rectangle if character argument is
Area of rectangle = l * b
Diagonal of cube = a√3
Perimeter = 2 (l * b)
Question 9: [15]
Write a program in java to accept 10 different numbers and display the greatest and the smallest of
the numbers