Computer Applications ICSE Sample Paper 7 - Decrypted
Computer Applications ICSE Sample Paper 7 - Decrypted
COMPUTER APPLICATIONS
(Theory)
(Two hours)
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.
Question 1.
Question 2.
(a) Detect errors if any in the below given statement and rewrite it correctly:
If(2x + 5 = 10 && x>0) [2]
(b) String s1="I LOVE"; [4]
String s2 = "JAVA FOR SCHOOL";
(i) System.out.println(s1.substring(0).concat(s2.substring(0,4))
(ii) System.out.println(s2.substring(2,10));
(iii) System.out.println(s2.replace('O', 'o'));
(iv) System.out.println(s2.charAt(s1.indexOf('V') + s2.indexOf('H')));
(c) Write a Java statement to:
(i) Extract the second last character of a word stored in the variable wd.
(ii) Check if the second character of a string 'str' is in uppercase [2]
(e) What is the use of the keyword import? [2]
Question 4.
(a) State the output of the following program segment according to the inputs as mentioned:
with each part: [4]
if(x++ == 11)
System.out.print("RESULT IS 11");
else if(++x == 10)
System.out.print("RESULT IS 10");
else if(- -x == 10)
System.out.print("RESULT IS 10");
else
System.out.print("RESULT IS NEITHER 10 NOR 11");
( )
(d) Write a Java expression for: [2]
√
(e) Write the prototype of a function 'divide' that takes two integer values and returns the
quotient in double type. [1]
(f) Name the package which contains the Scanner class? [1]
2
TSP007 © www.javaforschool.com
JAVA FOR SCHOOL SAMPLE PAPER 7
Making Java Fun To Learn ICSE (Class X)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Question 5. [15]
void display() : output the details of the employee as per given format:
Question 6. [15]
Write a Java program to accept a string. Extract the last character from it and form a new string after
adding the extracted character at the first and last places in the given string. Print the entered and
new string.
Sample Input : Java
Sample Ouptut : aJavaa (where 'a' is the last character in the string Java)
Question 7. [15]
Question 8. [15]
Write a Java program to print the reverse of all the numbers in the range 'p' to 'q', where p<q (both
inclusive). Print the output in the following format:
Number Reverse
---------- ----------
---------- ----------
---------- ----------
Question 9. [15]
(ii) double pattern(double x, double n) with two double arguments and returns the sum
of the series,
x x x x x
S= + + + ⋯+ …+
n −1 n−2 2 1
Write a program to input an integer array A[] of n size. Store all even integers of array A[]
from left to right and all odd integers from right to left in another array B[]. Print both the arrays.
Example : If A[] = {3, 6, 9, 5, 12, 14, 8, 18, 7, 21, 10, 4} then,
B[] = {6, 12, 14, 8, 18, 10, 4, 21, 7, 5, 9, 3}
4
TSP007 © www.javaforschool.com