Computer Application Sic Se
Computer Application Sic Se
com
Upload and share your papers and class notes on ResPaper.com. It is FREE!
ResPaper.com has a large collection of board papers, competitive exams
and entrance tests.
http://www.respaper.com/
Page 1
Page 2
Page 3
Page 4
Upload and share your papers and class notes on ResPaper.com. It is FREE!
ResPaper.com has a large collection of board papers, competitive exams
and entrance tests.
http://www.respaper.com/
Page 1
Page 2
Page 3
Page 4
Upload and share your papers and class notes on ResPaper.com. It is FREE!
ResPaper.com has a large collection of board papers, competitive exams
and entrance tests.
http://www.respaper.com/
Page 1
Page 2
Page 3
Page 4
Upload and share your papers and class notes on ResPaper.com. It is FREE!
ResPaper.com has a large collection of board papers, competitive exams
and entrance tests.
http://www.respaper.com/
Page 1
Page 2
Page 3
Page 4
Page 5
Page 6
Page 7
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.
This Paper is divided into two Sections.
Attempt all questions from Section A and any four questions from Section B.
The intended marks for questions or parts of questions are given in brackets [ ].
[2]
(b)
What is a literal?
[2]
(c)
(ii)
(d)
(e)
[2]
[2]
double x = 15.2;
int y = (int) x;
(ii)
int x = 12;
long y = x;
[2]
Question 2.
(a)
[2]
(b)
What is the difference between a break statement and a continue statement when
they occur in a loop?
[2]
T13 861
Turn over
(c)
Write statements to show how finding the length of a character array and char[] differs
from finding the length of a String object str.
(d)
(e)
[2]
(ii)
[2]
What is an exception?
[2]
Question 3.
(a)
(b)
[2]
[2]
(c)
[2]
(d)
(e)
[2]
How many times will the following loop execute? What value will be returned?
int x = 2, y = 50;
do{
++x;
y - = x++;
} while(x<=10);
return y;
(f)
[2]
What is the data type that the following library functions return?
(i)
isWhitespace(char ch)
(ii)
Math.random()
[2]
ut + ft
(g)
(h)
[2]
x=Math.pow(n[4],n[2]);
y=Math.sqrt(n[5]+[7]);
[2]
2
T13 861
www.javaforschool.com
(i)
What is the final value of ctr when the iteration process given below, executes?
int ctr=0;
for(int i=1;i<=5;i++)
for(int j=1;j<=5;j+=2)
++ctr;
(j)
[2]
(ii)
[2]
Question 4.
Define a class named FruitJuice with the following description:
Instance variables/data members:
int product_code
String flavour
String pack_type
int pack_size
int product_price
Member Methods:
(i)
FriuitJuice()
T13 861
3
www.javaforschool.com
Turn over
(ii)
void input()
To input and store the product code, flavor, pack type, pack size
and product price.
To display the product code, flavor, pack type, pack size and
product price.
Question 5.
The International Standard Book Number (ISBN) is a unique numeric book identifier which is
printed on every book. The ISBN is based upon a 10-digit code. The ISBN is legal if:
1 x digit1 + 2 x digit2 + 3 x digit3 + 4 x digit4 + 5 x digit5 + 6 x digit6 + 7 x digit7 + 8 x digit8 +
9 x digit9 + 10 x digit10 is divisible by 11.
Example: For an ISBN 1401601499
Sum=1 x 1 + 2 x 4 + 3 x 0 + 4 x 1 + 5 x 6 + 6 x 0 + 7 x 1 + 8 x 4 + 9 x 9 + 10 x 9 = 253 which is
divisible by 11.
Write a program to:
(i)
(ii)
If the ISBN is not a 10-digit integer, output the message, "Illegal ISBN" and terminate the
program.
(iii)
If the number is 10-digit, extract the digits of the number and compute the sum as
explained above.
If the sum is divisible by 11, output the message, "Legal ISBN". If the sum is not
divisible by 11, output the message, "Illegal ISBN".
[15]
Question 6.
Write a program that encodes a word into Piglatin. To translate word into a Piglatin word,
convert the word into uppercase and then place the first vowel of the original word as the
start of the new word along with the remaining alphabets. The alphabets present before the
vowel being shifted towards the end followed by AY.
Sample input (1) : London,
[15]
4
T13 861
www.javaforschool.com
Question 7.
Write a program to input 10 integer elements in an array and sort them in descending
order using bubble sort technique.
[15]
Question 8.
Design a class to overload a function series() as follows:
(i)
double series(double n) with one double argument and returns the sum of the series,
sum =
(ii)
+ + + +
double series(double a, double n) with two double arguments and returns the sum
of the series,
sum =
+ to n terms
[15]
Question 9.
Using the switch statement, write a menu driven program:
(i)
To check and display whether a number input by the user is a composite number or
not (A number is said to be a composite, if it has one or more than one factor
excluding 1 and the number itself).
Example: 4, 6, 8, 9
(ii)
T13 861
5
www.javaforschool.com
[15]
Turn over
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.
This Paper is divided into two Sections.
Attempt all questions from Section A and any four questions from Section B.
The intended marks for questions or parts of questions are given in brackets [ ].
Give one example each of a primitive data type and a composite data type.
[2]
(b)
[2]
(c)
[2]
(d)
[2]
(e)
Name the type of error (syntax, runtime or logical error) in each case
given below:
(i)
Division by a variable that contains a value of zero.
(ii)
Multiplication operator used when the operation should be division.
(iii) Missing semicolon.
[2]
Question 2.
(a)
Create a class with one integer instance variable. Initialize the variable using:
(i)
default constructor.
(ii)
parameterized constructor.
T12 861
[2]
Turn over
(b)
[2]
(c)
[2]
(d)
Makes several passes through the array, selecting the next smallest
item in the array each time and placing it where it belongs in the
array.
At each stage, compares the sought key value with the key value of
the middle element of the array.
[2]
[2]
(ii)
(e)
Question 3.
(a)
What are the values of x and y when the following statements are executed?
int a=63, b=36;
boolean x = (a>b) ? true : false ;
int y = (a<b) ? a : b;
(b)
[2]
(c)
[2]
What will be the result stored in x after evaluating the following expression?
int x = 4; x+= (x++)+(++x)+x;
(d)
[2]
(e)
[2]
[2]
2
T12 861
www.javaforschool.com
(f)
(g)
State the data type and values of a and b after the following segment is
executed:
String s1= Computer, s2=Applications;
a = (s1.compareTo(s2));
b = (s1.equals(s2));
(h)
[2]
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);}
(j)
[2]
(i)
[2]
[2]
In the program given below, state the name and the value of the:
(i)
(ii)
(iii)
(iv)
class MyClass {
static int x = 7;
int y = 2;
public static void main(String args[]){
MyClass obj = new MyClass();
System.out.println(x);
obj.sampleMethod(5);
int a = 6;
System.out.println(a);
}
T12 861
3
www.javaforschool.com
Turn over
[2]
String title
String author
Member methods:
(i) void input()
To accept the number of days late, calculate and display the fine
charged at the rate of ` 2 per day.
Accession Number
Title
Author
Write a main method to create an object of the class and call the above member methods.
[15]
4
T12 861
www.javaforschool.com
Question 5.
Given below is a hypothetical table showing rates of income tax for male citizens
below the age of 65 years:
Taxable Income (TI) in `
Income Tax in `
Nil
` 5,00,000
Is greater than ` 5,00,000 & less than or equal to
` 8,00,000
Is greater than ` 8,00,000
Write a program to input the age, gender (male or female) and Taxable Income of a
person.
If the age is more than 65 years or the gender is female, display wrong category.
If the age is less than or equal to 65 years and the gender is male, compute and display
the Income Tax payable as per the table given above.
[15]
Question 6.
Write a program to accept a string. Convert the string to uppercase. Count and output the
number of double letter sequences that exist in the string.
Sample Input: SHE WAS FEEDING THE LITTLE RABBIT WITH AN APPLE
Sample Output: 4
[15]
Question 7.
Design a class to overload a function polygon() as follows:
(i) void polygon(int n, char ch)
T12 861
5
www.javaforschool.com
Turn over
Example:
(i)
(ii)
Input value of x = 2, y = 5
Output:
@@@@@
@@@@@
(iii)
Output:
*
**
***
[15]
Question 8.
Using the switch statement, write a menu driven program to:
(i)
(ii)
15390
Sum of the digits = 18
[15]
Question 9.
Write a program to accept the names of 10 cities in a single dimension string array and
their STD (Subscribers Trunk Dialing) codes in another single dimension integer array.
Search for a name of a city input by the user in the list. If found, display Search
Successful and print the name of the city along with its STD code, or else display
the message Search Unsuccessful, No such city in the list.
[15]
6
T12 861
www.javaforschool.com
Upload and share your papers and class notes on ResPaper.com. It is FREE!
ResPaper.com has a large collection of board papers, competitive exams
and entrance tests.
http://www.respaper.com/
Page 1
Page 2
Page 3
Upload and share your papers and class notes on ResPaper.com. It is FREE!
ResPaper.com has a large collection of board papers, competitive exams
and entrance tests.
http://www.respaper.com/
Page 1
Page 2
Page 3
Page 4
Upload and share your papers and class notes on ResPaper.com. It is FREE!
ResPaper.com has a large collection of board papers, competitive exams
and entrance tests.
http://www.respaper.com/
Page 1
Page 2
Page 3
Page 4
Upload and share your papers and class notes on ResPaper.com. It is FREE!
ResPaper.com has a large collection of board papers, competitive exams
and entrance tests.
http://www.respaper.com/
Page 1
Page 2
Page 3
Page 4
Upload and share your papers and class notes on ResPaper.com. It is FREE!
ResPaper.com has a large collection of board papers, competitive exams
and entrance tests.
http://www.respaper.com/
Page 1
Page 2
Page 3
Page 4
Upload and share your papers and class notes on ResPaper.com. It is FREE!
ResPaper.com has a large collection of board papers, competitive exams
and entrance tests.
http://www.respaper.com/
Page 1
Page 2
Page 3
Page 4
Prelium 2013
ST. GREGORIOS IIIGH SCHOOL
std. x
COMPUTER APPLICATIONS
to this paper
on me paper
separately. You
allowed to write during the first 10 minutes. Thistime to be spent in reading the question
paper. The time given at the head of this paper is time allowed for the writin-g the answers
This paper is divided into two sections. You are to answer allquestions from section A, and
any four questions from section B. The intended
ryarkslor questions or parts of questions are
given in brackets [].
'
Atte,o';fo"Jj$:ffi#l[il,""tion.
Question 1.
Answerthe following.
What is meant by precedence of operators ?
b) What is a null statement in java ?
c) Name any two wrapper class.
d) How are data and functions organized in OOp ?
e) What is meant by base type of an anay ?
t5x2I
i)
Question 2.
Difference between the following.
a) Constructor and rnethod.
b) Class and object.
c) Operator and operand.
d) Local and globalvariable.
.e) SlecUon controland iteration control.
QuesUon 3.
Give the ouiput of the tuilowing.
a) How many times will the foltowing loop execute? What.;alue wiil be the value
Of x?
int x=2, y=S0;
t5x2l
[5x2]
do
{
++xlY-=x++;
)while(x<=10);
i.Dtiii ;,
b) lf
int
D
ii)
c)
char m= 'A; int p = 25; wtrat will be tre ouput of the statement ?
System.but. prinfl n((char)m+p1 ;
System.out.println('answer' + m+p);-
d)
n
Secret to 90% in Boards
n[
Sy$tern.out.println(slil.eharAt(i));
)
,
I Exam18.com
Buy FullPaee
Set from
.rl
ht
ICSE Sample Papers for March 'q
2015 Exams
e)
i) System.out.pritnln(Math.round(-5.49));
ii)
System.out.pritnln(Math. rintG5.49));
iii) System.out.pritnln(Math.ceilG0.03)) ;
iv) System.out.pritnln(Math.fl oor(-0.03))
v) Syetem.out.pritnln(Math.ceil(O.03));
[5x2]
Question 4.
a)
if the following snippets are conect, show,the output, if not specify the
i)
ii)
if (a>b)
if(a>b);
t
d=9;
else
System.out. println(d);
d=9;
)
System.out. println(d);
iii)
'
iv)
int i=5;
while(i==S)
if(i==5)
continue;
int x=10;
i++;
System.out.
v)
Pri
ntln(i)
pr"oq,,*"il:[;H[U,:Xfi'[it""l1H#i;ff
'llLqurrcdw*h
Qugtion 5.
,/
Design the class to catculate and diplay sum of odd digits and product of even
name
Yo'd
: Calculate
Class
lnstance variable ldala member:
: integer, to store number.
Member function / methods :: to accept the number.
void inputQ
: to calculate antrc{rrn sum of odd digits
ialcalc(int)
of even digits.
Example
product
.13/,526
surn will be 1+3+5 = 9
PaseZ
and
"r'l
Buy Full Set from Exam18.com
How to Pay?
You can Pay for these Books using your Credit Card/Debit Card/NetBanking or Cash
on Delivery.
Delivery Time
Delivered in 1-7 days after Placing your Order on Exam18.com
Want to get this Complete Book? Click here to Order E-Book (Only Online Payment
Option Available since it is E-Book and delivered instantly to your Email after Payment)
Click here to Order Printed Book
Visit Exam18.com Or Call Helpline 07666303006 or email [email protected]
SAMPLE PAPER 8
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.
This Paper is divided into two Sections.
Attempt all questions from Section A and any four questions from Section B.
The intended marks for questions or parts of questions are given in brackets [ ].
Question 1.
(a)
(b)
[2]
[2]
(c)
Write a Java statement to create an object named 'jfs' of a class 'Computer' that invokes
a parameterized constructor that accepts two integer type values.
[2]
(d)
[2]
(e)
[2]
+3
Question 2.
(a)
(b)
(c)
Assign the constant value of pi (i.e. 3.142) to a variable mentioning its appropriate
data type.
[2]
(ii)
[2]
(d)
(e)
n = Math.pow(Math.min(A[1],A[7]), A[3]);
[2]
[2]
[2]
www.javaforschool.com
Turn over
SAMPLE PAPER 8
(b)
[3]
System.out.println(s1.compareTo(s2));
System.out.println(s1.concat(" Still ").concat(s2));
[2]
(c)
[2]
(d)
Find the errors in the following code snippet and correct them:
boolean true = a;
If(false)
System.Out.Println("Nothing in here")
else
System.out.println(Correct this mistake);
[3]
Question 4.
(a)
(b)
(c)
State the purpose and return datatype of the following wrapper class functions:
(i)
toString(long n)
(ii)
parseLong(String s)
[2]
[2]
Analyze the following program segment and answer the following questions:
class JavaForSchool
{
public void methodInfo()
{
char a = 'A', b = 'a';
int c = a++ + b;
}
}
(i)
(ii)
(iii)
(iv)
(d)
[4]
[2]
2
TSP008
www.javaforschool.com
SAMPLE PAPER 8
[15]
[15]
:
:
:
to store a word
to store the highest alphabetical character present in the word
to store the lowest alphabetical character present in the word
Member functions:
WordOp()
void input()
void calcMaxMin()
void display()
:
:
:
:
default constructor
to accept the word in UPPERCASE
to find the highest and the lowest character present in the word.
to display the word along with the highest and the lowest character
Example:
If word is "TWEAK"
Highest Character = W
Lowest Character = A
Question 7.
[15]
volume =
(ii)
volume =
(i)
3
TSP008
www.javaforschool.com
Turn over
SAMPLE PAPER 8
[15]
The production (P) of crude oil of a country in millions of barrels may be estimated by the
following set of equations, where t represents the time duration in years:
P = 5 + 3t
P = 14 + (t - 5/2)2
for 0 t 3
for t > 3
Write a program in Java to input a year from the user and find and print the production for
every year from the year 2000 to the inputted year.
Print the output in the following format:
Year
----------------------------
Production
----------------------------
Question 9.
[15]
A cloth showroom has announced the following seasonal discounts on purchase of items:
Purchase Amount (`)
0 - 1000
Discount
Mill Cloth
Handloom Items
-------
5%
1001 - 2000
5%
7.5 %
2001 - 3000
7.5 %
10 %
Above 3000
10 %
15 %
Write a Java program to input the purchase amount and Item Code viz : M or m for Mill Cloth
and H or h for Handloom Items.
Calculate the discount amount. Find the net balance to be paid excluding the discount.
Print the Purchase Amount, Item Type, Discount and the net amount to be paid.
Question 10.
[15]
Write a program to input an integer array A[] of n size. Sort the array in ascending order.
Then input another number from the user and replace all the numbers less than that inputted
number by their reverse.
Example
4
TSP008
www.javaforschool.com
SAMPLE PAPER 7
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.
This Paper is divided into two Sections.
Attempt all questions from Section A and any four questions from Section B.
The intended marks for questions or parts of questions are given in brackets [ ].
Question 1.
(a)
(b)
[2]
[2]
(c)
[2]
(d)
[2]
(e)
[2]
Question 2.
(a)
(ii)
[2]
(b)
[2]
(c)
[2]
(d)
(e)
[2]
(i)
endsWith()
(ii)
random()
[2]
www.javaforschool.com
Turn over
SAMPLE PAPER 7
Detect errors if any in the below given statement and rewrite it correctly:
If(2x + 5 = 10 && x>0)
[2]
(b)
String
String
(i)
(ii)
(iii)
(iv)
[4]
(c)
(e)
s1="I LOVE";
s2 = "JAVA FOR SCHOOL";
System.out.println(s1.substring(0).concat(s2.substring(0,4))
System.out.println(s2.substring(2,10));
System.out.println(s2.replace('O', 'o'));
System.out.println(s2.charAt(s1.indexOf('V') + s2.indexOf('H')));
(i)
Extract the second last character of a word stored in the variable wd.
(ii)
[2]
[2]
Question 4.
(a)
State the output of the following program segment according to the inputs as mentioned:
with each part:
if(x++ == 11)
System.out.print("RESULT
else if(++x == 10)
System.out.print("RESULT
else if(- -x == 10)
System.out.print("RESULT
else
System.out.print("RESULT
(i)
(c)
x=9
(ii)
IS 11");
IS 10");
IS 10");
IS NEITHER 10 NOR 11");
x = 10
(iii)
x = 11
(iv)
x = 12
(ii)
Math.rint(32.17)
[2]
(d)
(e)
Write the prototype of a function 'divide' that takes two integer values and returns the
quotient in double type.
Name the package which contains the Scanner class?
(f)
[4]
[2]
[1]
[1]
2
TSP007
www.javaforschool.com
SAMPLE PAPER 7
[15]
:
:
:
:
to
to
to
to
store
store
store
store
Member functions:
Employee()
void input()
void calc()
:
:
:
default constructor
to accept the pan number, name and taxable income
calculate the tax for an employee according to the given conditions:
Pan Number
___________
Name
_____
Tax Rate
No tax
10% of the income exceeding Rs. 100000
Rs. 5000 + 20% of the income exceeding Rs. 150000
Rs. 25000 + 30% of the income exceeding Rs. 250000
Question 6.
Tax
____
[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)
3
TSP007
www.javaforschool.com
Turn over
SAMPLE PAPER 7
[15]
A number is said to be NEON, if sum of all the digits of the square of the number
is equal to the number itself.
For example 9 is a NEON number
(Workings: Square of 9 = 81. Sum of digits of square: 8 + 1 = 9)
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]
void pattern(char ch, int n) with one character and one integer argument and prints
'n' lines containing the character stored in 'ch' in the following pattern,
If ch = @ and n = 3, then output:
@
@@
@@@
(ii)
double pattern(double x, double n) with two double arguments and returns the sum
of the series,
S=
x
+
n
x
x
x
x
+
+ + +
1 n2
2
1
Question 10.
[15]
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
SAMPLE PAPER 6
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.
This Paper is divided into two Sections.
Attempt all questions from Section A and any four questions from Section B.
The intended marks for questions or parts of questions are given in brackets [ ].
[2]
(i)
(ii)
[2]
(c)
[2]
(d)
[2]
(e)
Write statements to show how finding the length of a character array ch[] differs
from finding the length of a String object str.
[2]
Question 2.
(a)
(ii)
[2]
(b)
[2]
(c)
[2]
(d)
(e)
[2]
(i)
trim()
(ii)
isWhitespace()
[2]
www.javaforschool.com
Turn over
SAMPLE PAPER 6
[2]
(b)
[2]
(c)
(d)
(e)
(i)
(ii)
[2]
(ii)
Math.ceil (32.17)
[2]
[2]
Question 4.
(a)
(b)
Based on the above given piece of code, answer the questions which follow:
(i)
(ii)
(iii)
(c)
[2]
[3]
Given a character array: char arr[] = {'J', 'A', 'V', 'A'}; and an integer: int b = 2;
What will be the output of the below statements if they are executed one after the other:
(i)
System.out.println(arr[b++]);
x=
(ii)
System.out.println(arr[b]++);
(d)
(e)
Write the prototype of a function which takes in 2 integer and 1 String arguments, and
returns a value which is either 'true' or 'false'
[2]
[2]
[1]
2
TSP006
www.javaforschool.com
SAMPLE PAPER 6
[15]
Write a menu driven program in Java to input a number and check whether it is a:
(a)
DISARIUM number or not
(b)
DUCK number or not
Note:
DISARIUM: A number will be called DISARIUM if sum of its digits powered with their respective
position is equal to the original number.
For example 135 is a DISARIUM
(Workings 11+32+52 = 135, some other DISARIUM are 89, 175, 518 etc)
DUCK:
A Duck number is a number which has zeroes present in it, but there should be no
zero present in the beginning of the number.
For example 3210, 7056, 8430709 are all Duck numbers whereas 08237 is not.
Question 6.
[15]
An airlines announces discount on tickets depending upon destination chosen by the passenger from
the following:
Destination
America
Singapore
Japan
Thailand
Write a Java program to input name of the passenger/group head (in case of more than 1 passengers),
number of passengers and destination code viz: A or a for America, S or s for Singapore, J or j for
Japan, and T or t for Thailand.
Calculate the total ticket amount and discount amount. Find the net balance to be paid excluding the
discount. Print name, number of passengers, destination code, discount and total ticket amount to be
paid.
3
TSP006
www.javaforschool.com
Turn over
SAMPLE PAPER 6
:
:
:
Member functions:
Capitalize()
:
void readsentence() :
void capfirstlast()
:
void display()
default constructor
to accept the sentence
extract each word and capitalize the first and the last alphabet of the word
and form a new sentence 'rev' using the changed words
display the original sentence along with the new changed sentence.
Specify the class Capitalize giving details of the constructor Capitalize (), void readsentence(), void
capfirstlast() and void display(). Define the main() function to create an object and call the function
accordingly to enable the task.
Question 8.
[15]
Write a Java program to input a sentence. Count the number of times a particular word occurs in it.
Display the frequency of the search word.
Sample Input
Sample Ouptut
Enter a sentence
Enter a word to be searched
Frequency of searched word
:
:
:
To be or not to be
be
2
Question 9.
[15]
double series(double n) with one double argument and returns the sum of the series,
S=1+
(ii)
1 1
1
+ + +
2! 3!
n!
double series(double x, double n) with two double arguments and returns the sum
of the series,
S=
x x
x
x
+ + + +
1 4
9
n
Question 10.
[15]
Write a program to input two integer arrays A[] and B[] of m and n sizes respectively. Create a
third array C[] by merging the array A[] followed by the array B[].
Sample Input
Sample Output
:
:
4
TSP006
www.javaforschool.com
SAMPLE PAPER 5
COMPUTER APPLICATIONS
(THEORY)
(Two hours)
(Full 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 into two Sections.
Attempt all questions from Section A and any four questions from Section B.
The intended marks for questions or parts of questions are given in brackets [ ].
[2]
[1]
[2]
[2]
[3]
Question 2.
(a)
(b)
(c)
(d)
[2]
[2]
[2]
[4]
class Sample {
public void main [ ] ; {
x=2
y = 2.2;
float z = x * y;
System.out.printline("Value of x++ = " (x++)
system.out.println("Value of z = " + z)
}
}
www.javaforschool.com
Turn over
SAMPLE PAPER 5
[3]
(b)
(c)
What is a constructor?
State whether the following are true or false:
(i)
"After creating an array the size cannot be altered"
(ii)
"int arr [ ] and int [ ] arr are both valid declarations"
Write a statement for each of the following:
(i)
Store a number 354 as a String.
(ii)
Convert the String to a numeric value.
(iii)
Add it to the existing total of 1000 to update the total.
[2]
[2]
(d)
[3]
Question 4.
(a)
(b)
[2]
[2]
(c)
What is the difference between a break statement and a continue statement when
they occur in a loop?
ut + ft
(d)
(e)
[2]
[2]
[2]
void whyPattern()
{
for(int i=?1?; i<?2?;i++)
{
for(int j=1;j<=?3?;j++)
{
System.out.print(?4?+" ");
}
System.out.println();
}
}
2
TSP005
www.javaforschool.com
SAMPLE PAPER 5
Where P - is the Principal amount, r rate of interest and t time period in years.
Data members of class : pamt, rate (double data type to store principal amount and rate of
interest), time (integer to store time period)
Functions of the class :
(i)
(ii)
(iii)
(iv)
Write a main function to input required data and by invoking suitable functions print the
entered data and compound interest.
[15]
Question 6.
A hotel is giving seasonal discount on the total amount to be paid by the person staying at the
time of check out. The charges for one day stay is `850.0 per room. The discount will be given as
per the following criteria:
Number of days stayed
Upto 5 days
> 5 days and <= 10 days
> 10 days and <= 20 days
More than 20 days
Write a program to input name of guest, total number of days stayed in the hotel.
Calculate the total amount to be paid and discount amount. Find the net balance to be paid
excluding the discount. Print the bill including all the data.
[15]
Question 7.
Write a program in Java to print all the ARMSTRONG numbers in the range between m and n
(both inclusive). The input contains two positive integers m and n, where m<n and m<3000 and
n<3000.
[Note: An Armstrong number is a number which is equal to the sum of the cube of its digits]
[15]
3
TSP005
www.javaforschool.com
Turn over
SAMPLE PAPER 5
S=
(b)
n terms
Input an integer and print the sum of first and last digits of that number.
Example:
Input
:
n = 8452
Output
:
Sum of first and last digit = 8+2 = 10
Question 9.
(a)
(b)
Write a program to accept a String. Convert the string to Uppercase. Count and output
the number of double letter sequences that exist in the string.
Sample Input
:
"SHE WAS FEEDING THE LITTLE RABBIT WITH AN APPLE"
Sample Output
:
4
[7]
Write a program to accept a String and convert its into its Piglatin form.
To translate word into a Piglatin word, convert the word into Uppercase and then place
the first vowel of the original word as the start of the new word along with the remaining
alphabets. The alphabets present before the vowel being shifted towards the end followed
by "AY".
Sample Input (1) : London,
Sample Output (1) : ONDONLAY
Sample Input (2) : Olympics,
Sample Output (2) : OLYMPICSAY
[8]
Question 10.
Write a menu driven program to generate a triangle or a pyramid based upon the users choice:
(a)
A
AB
ABC
ABCD
ABCDE
(b)
B
C C C
D D D D
E E E E E
Example 1:
Input:
Output:
A
B
Example 2:
Type 1 for a Triangle or
Type 2 for a Pyramid: 1
A
AB
ABC
ABCD
ABCDE
Input:
Output:
[15]
4
TSP005
www.javaforschool.com
SAMPLE PAPER 4
ICSE (Class X)
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.
This Paper is divided into two Sections.
Attempt all questions from Section A and any four questions from Section B.
The intended marks for questions or parts of questions are given in brackets [ ].
(d)
(e)
[2]
[2]
[2]
[2]
[2]
Question 2.
(a)
(b)
(c)
(d)
(e)
[2]
[2]
[2]
[2]
[2]
Question 3.
(a)
(b)
(c)
(d)
(e)
[2]
[2]
[2]
[2]
[2]
www.javaforschool.com
Turn over
SAMPLE PAPER 4
ICSE (Class X)
Question 4.
(a)
(b)
(c)
(d)
[2]
[3]
[2]
[3]
Convert it into its equivalent Binary number using the function void binary(int)
Convert it into its equivalent Roman number using the function void roman(int)
[15]
Question 7.
Write a Java program to input a sentence from the user and display the words which contain the
alphabet 'A' in them in either Lowercase or Uppercase.
Sample Input
:
All is well that ends well.
Sample Ouptut
:
All
that
[15]
2
TSP004
www.javaforschool.com
Turn over
SAMPLE PAPER 4
ICSE (Class X)
A Credit card company allows a limit to spend `15000 to its clients. It also offers a cash back
facility according the table shown below. Input the amount spent by the use and display the
cash back amount he is entitled to. Use minimum number of conditions to solve the problem.
Amount (in `)
First 1000
Next 2000
Next 4000
Next 8000
Write a program to declare the class 'Credit' that takes in the name of the client and the
amount spend by him. Calculate the cash back amount and print it along with all the other
details.
[Note: Perform this for 20 clients. Hint: Use Arrays]
[15]
Question 9.
(a)
A "XYZ Bank Ltd." accepts for one year or more and the rule that bank adopts for paying
the interest is as follows:
(i)
If a deposit is less than ` 2000 and it is for 2 years or more, the interest rate is
5% compounded annually.
(ii)
If a deposit is ` 2000 or more but less than ` 6000 and for 2 years or more, the
interest rate is 7% compounded annually.
If a deposit is more than ` 6000 and it is for 1 year or more, the interest rate is
8% compounded annually.
(iv)
On all deposits for 5 years or more, interest is 9.75% compounded annually.
(v)
On all other deposits not under the above conditions, the interest is 3%
compounded annually.
Write a program to input amount to deposit and number of years. Calculate the interest
and total balance amount after the given number of years. Print amount deposited,
number of years, interest gained and total amount paid after the given years.
[8]
The production (P) of crude oil of a country in millions of barrels may be estimated
by the following set of instructions:
P = 5 + 3t,
for 0 < t < = 3
P = 14 + (t 5/2), for t >3
Write a program in Java to find the quantity of production for every year t = 1 to 10
and print it.
[7]
(iii)
(b)
Question 10.
(a)
(b)
[7]
[8]
www.javaforschool.com
Turn over
SAMPLE PAPER 3
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.
This Paper is divided into two Sections.
Attempt all questions from Section A and any four questions from Section B.
The intended marks for questions or parts of questions are given in brackets [ ].
(c)
(d)
(e)
[2]
[2]
[2]
[2]
[2]
Question 2.
(a)
[4]
String s1 = "TRANSITION";
String s2 = "MOCK TEST";
(i)
(ii)
(iii)
(iv)
System.out.println(s1.substring(0,3).concat(s2.substring(5));
System.out.println((int)s2.charAt(6));
System.out.println(s1.replace('T','F'));
System.out.println(s1.charAt(s1.indexOf('R')+s2.indexOf('T')));
www.javaforschool.com
Turn over
SAMPLE PAPER 3
[2]
(d)
What is the size in the memory required to store 15 elements in an Array A[] when:
(i)
A[] is of long data type
(ii)
A[] is of character data type
[2]
Question 3.
(a)
[2]
(b)
What are packages? Write the Java statement for importing a package named 'happy'.
[2]
(c)
(d)
(e)
.
What is the advantage of the call by value method over call by reference ?
[1]
[2]
State the output of the below function when m=36, n=54? What is the method computing? [3]
void calc(int m, int n)
{
while(n!=m)
{
if(n>m)
n=n-m;
else
m=m-n;
}
System.out.println("Output = "+n);
}
Question 4.
(a)
[4]
2
TSP003
www.javaforschool.com
SAMPLE PAPER 3
[2]
(c)
[2]
(d)
Write the function "check" which takes two integer arguments (x,y) and returns 'true'
if x>y otherwise returns 'false'
[2]
Stream
90
80
70
60
and above
89
79
69
Write a program to declare the class 'Student' and calculate the average of every student and the
stream assigned to them. Display the result in the format given below:
Name
..
..
Roll No.
Total Marks
..
..
Average
Stream
[15]
Question 6.
Write a program in Java to accept the name and contact numbers of 25 people. The program
should ask the user for a contact number and search for it in the contact numbers array using
the Binary Search technique. If the number is found, then the corresponding name is displayed
otherwise a proper error message is displayed.
[15]
3
TSP003
www.javaforschool.com
Turn over
SAMPLE PAPER 3
Input an integer number and print the greatest and the smallest digits present in the number.
Example:
Input: n=2943
Output: Greatest digit = 9 and Smallest digit = 2
(b)
Input a line of text from the user and create a new word formed out of the first letter of each
word and convert the new word into Uppercase.
Example:
Input: Mangoes are delivered after Midday
Output: MADAM
[15]
Question 8.
The sum of two distances is calculated as:
Distance 1 =
10 feets
24 inches
Distance 2 =
5 feets
16 inches
Sum of Distances = 18 feets
4 inches
A class Distance has the following members:
Class Name
Data members
:
:
Member methods
:
:
:
Distance
f1,f2 (integers to store the feet value of 2 distances)
inc1,inc2 (integers to store the inch value of 2 distances)
Write a program in Java to input two distances and calculate their sum by applying proper
adjustments. Display the final result with appropriate message. [Given 1 feet = 12 inches]
[15]
Question 9.
Design a class to overload a function printSeries( ) as follows:
(a) void printSeries(int) to compute the series:
[15]
+ +
[15]
4
TSP003
www.javaforschool.com
SAMPLE PAPER 3
HiArm
:
:
Member functions/methods
HiArm ( )
HiArm (int a)
int sumArm (int)
void isArm ( )
:
:
:
:
:
constructor to assign 0 to n
constructor to assign a to n
to find and return the sum of cube of digits of a number
to invoke sumArm ( ) and print whether the number is
Armstrong or not
Then write the main( ) method to input a number and call the above functions as required to check
whether it is an Armstrong number or not.
[Note: An Armstrong number is a number which is equal to the sum of the cube of its digits.
Example of an Armstrong Number is 153 = 13+53+33 = 153]
[15]
5
TSP003
www.javaforschool.com
Turn over
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.
This Paper is divided into two Sections.
Attempt all questions from Section A and any four questions from Section B.
The intended marks for questions or parts of questions are given in brackets [ ].
(e)
What is JVM?
What are Unary and Binary Operators? Give examples of each.
What is an Infinite loop? Write an example of it using for-loop.
What will be the result of the following if n = 3.5
(i)
Math.ceil(n)
(ii)
Math.round(n)
(iii)
Math.floor(n)
If x = 6, y = 4 and z = 2.3, evaluate u and v after executing successively (i) and (ii):
(i)
u = x + y / z;
(ii)
v = (x++)*z + x;
[2]
[2]
[2]
[2]
[2]
Question 2.
(a)
[3]
(b)
(c)
What is exception handling? Name any one way in which Java handles exceptions.
Which part of a function declaration differentiates between overloaded functions?
[2]
[2]
www.javaforschool.com
Turn over
(d)
(e)
[2]
[1]
Question 3.
(a)
(b)
(c)
Write a for loop statement that initializes a loop variable k as 100, decrements it by 1 in
every pass and executes the loop body infinite no. of times.?
Give the output in the following function and also write what mathematical operation it
carries out if value of n = 10:
void test1(int n)
{
for(int i=1; i< = n; i++)
{
System.out.println (++i);
}
}
(d)
[1]
[2]
Question 4.
(a)
Fill in the blank numbers from ?1? to ?5? in the following program that attempts to sort an
array A[ ] of 15 integers in descending order using the Bubble sort technique:
[5]
void BubbleSort ( int a[ ] )
{
int t = __?1?__ ;
for(int i = 0 ; i < __?2?__ ; i++)
{
for(int j = 0 ; j < __?3?__ ; j++)
{
if(____?4?____)
{
t = a[j];
___?5?___
a[j+1] = t;
}
}
}
}
2
TSP 002
www.javaforschool.com
(b)
(c)
[2]
[3]
class Academic
{
int x,y;
void access( )
{
int a,b;
Academic student = new Academic( );
System.out.println(Object created);
}
}
(i) What is the object name of class Academic?
(ii) Name the class variable used in this program.
(iii) Write the local variable used in this program.
Question 5.
Create a class SalaryCalculation that is described as below:
Class Name
: SalaryCalculation
Data members
Member methods
(i) SalaryCalculation( )
TSP 002
www.javaforschool.com
Turn over
Write a program in Java to calculate all the details mentioned above and print them all.
[15]
Question 6.
Write a program to accept a string. Convert the string to uppercase. Count and output the
number of Consecutive letter pairs that exist in the string.
Sample Input:
[15]
Question 7.
Using the switch statement, write a menu driven program to:
(i)
(ii)
[15]
Question 8.
Design a class to overload a function print ( ) as follows:
[15]
(a) void print (int x, int y) to print the odd numbers between the x and y.
(b) void print (char ch1, char ch2) to print all the consonants between the 2 characters ch1 & ch2.
(c) void print (char ch, int n) to print the character ch, n number of times in the given format:
Example: If ch = $ and n = 4
Output:
$$$$
$$$
$$
$
4
TSP 002
www.javaforschool.com
Question 9.
Write a program in Java to input a number from the user and print the frequency of each digits present
in it.
Example:
Input
43457973
Output
Digit
4
3
5
7
9
Frequency
2
2
1
2
1
[Note: Only those digits should be printed which are present in the number]
[15]
Question 10.
Write a program in Java to accept the name and weight of 20 of your friends. Store the weight
in a double type array weight [ ] and the name in a String type array name [ ]. Then sort the
name of your friends in ascending order of their weights and finally print the result.
[15]
TSP 002
www.javaforschool.com
Turn over
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.
This Paper is divided into two Sections.
Attempt all questions from Section A and any four questions from Section B.
The intended marks for questions or parts of questions are given in brackets [ ].
[2]
[2]
[2]
[2]
[2]
Question 2.
(a)
(b)
[2]
(c)
Explain with the help of an example, the purpose of default in a switch-case construct.
Give an example each for:
(i)
Runtime Error
(ii)
Syntax Error
(iii)
Logical Error
Differentiate between equals ( ) and compareTo ( ) functions.
(d)
(e)
+ 25 /
Write a Java expression for 6
Write Java statements to find if a character variable called var contains an alphabet or not.
[2]
[2]
[2]
[2]
Question 3.
(a)
TSP 001
[2]
[2]
This Paper consists of 4 printed pages.
www.javaforschool.com
Turn over
(b)
(c)
(d)
Write Java statements to check if the 5th element of an array X [10] is divisible by 2.
What is a constructor and what is its use?
Give the output in the following function definitions and also write what mathematical operation it
carries out if value of n = 7:
void test1(int n)
{
for(int x=1; x< = n; x++)
if(n%x = = 0)
System.out.println (x);
}
[2]
[2]
[2]
Question 4.
(a)
(b)
(c)
(d)
Fill in the blank numbers from 1 to 5 in the following program that attempts to find 5n :
class Power
{
int getresult ( __1__)
{
int pro = __2__ ;
for(int i=1; i< = n; i++)
pro = pro * __3__ ;
__4__ ;
}
void callerFunct ( )
{
int p;
__5__ ;
//calling function getresult ( )
System.out.print (p);
}
}
[5]
Determine the errors in the following statements of Java programs and correct them:
(i)
String x = {Java,for,School,Students, Rocks};
(ii)
String s = Apple.equals(Banana);
[2]
[2]
[1]
2
TSP 001
www.javaforschool.com
Write a program to compute the monthly bill to be paid according to the given conditions:
Calls made
Rate
Up to 100 calls
No charge
However every customer has to pay Rs. 180 per month as monthly rent for availing the service.
[15]
Question 6.
Write a program in Java to input a word. Arrange all the alphabets of the word in ascending order and display
the new word.
Sample Input: BLUEJ
Sample Output: BEJLU
TSP 001
[15]
3
www.javaforschool.com
Turn over
Question 7.
Write a program in Java to accept two integer arrays from the user and join them into a third array. After joining
the arrays, sort the final array in ascending order using Bubble sort technique.
Sample Input: Array A [ ] = {5,6,45,17,2,58,33};
Array B [ ] = {13,25,1,0,7,9};
Sample Output: The final Array after joining is :
The final Array after sorting is :
5 6 45 17 2 58 33 13 25 1 0 7 9
0 1 2 5 6 7 9 13 17 25 33 45 58
[15]
Question 8.
Write a menu driven program to perform the following: (Use switch-case statement)
(a)
To input a word from the user and print it in the following pattern:
J
JA
JAV
JAVA
(b)
S=1+
[Note: ! denotes the factorial of a number which is equal to the product of the numbers
starting from 1 till that number. Example: 5! = 1 x 2 x 3 x 4 x 5]
[15]
Question 9.
Using Scanner class, write a program to input a string and display all those words of the string which begins
with a capital letter and end with a small letter.
Sample Input:
Sample Output:
[15]
Question 10.
Write a program to input two numbers and check whether they are Co-Prime number or not. Use the following
two functions in your program:
int calc_hcf (int, int) to find the HCF of the 2 numbers.
int prime (int) to check whether a number is a prime number or not.
[Note: Co-Prime numbers are numbers which are both prime and their HCF is 1]
[15]
4
TSP 001
www.javaforschool.com