Class – X
Subject – Computer Application
Subject – Computer Application
Time: 2 hour M.M
100
General Instructions to Solve the Paper
·
Each
paper consists of two Sections
·
Attempt
all questions in Section A and any four questions in Section B.
·
Section
A is of 40 marks and Section B is of 60 marks.
·
In
Section B each program should be written using variable description.
SECTION-A
[Attempt all questions]
Question 1. [5*2=10]
(a) Differentiate between class variable
and Instance variable.
(b) Mention two difference between Binary
search and Linear search?
(c) Define wrapper class.
(d) What do you mean by rvalue and
lvalue?
(e) Why is class also called composite
data type? Give an example also.
Question 2. [5*2=10]
(a) State the difference between
Constructor and Method.
(b) Define fall through.
(c) What is the difference between
ordinary compilation and Java compilation?
(d) What is the difference between String
and StringBuffer?
(e) What is meant by private visibility
of a method?
Question 3.
(a) Name the keyword that [3]
(i)
Transfers
the control to the beginning of the loop and skips the rest of the loop body.
(ii)
The
variables whose single copy is made for all the objects of a class.
(iii)
The
keyword that is used to distinguish between instance variable and local
variables.
(b) Give the output of the following: [2]
int
x=10;
int
y=20;
if((x<y)||(x=5)>10)
System.out.print(y);
else
System.out.print(x);
(c) What will be the output of the
following program segment? [2]
String
name[]={“Board”,”Examinations”};
System.out.println(name[0].length());
System.out.println(name.length());
(d) Find the output [3]
class
Aa
{
void display()
{
int a[]={2,5,8,5,3};
int i=2;
a[i]+=(a[i+1]++)-(--a[i-1]);
for(i=0;i<5;i++)
System.out.println(a[i]);
}
}
(e) Differentiate between base and
derived class. [2]
(f) Write the java expressions for
[2]

(g) Write function prototype that returns
a Boolean value and takes two characters as parameter. [2]
(h) In Java various Math functions are
defined in which class and under which package. [2]
(i) Write a single line statement using
ternary operator to find the maximum of three numbers. [2]
SECTION-B
[Attempt any four questions from this Section]
Question 4.
Define a class Salary in Java with
the following details:
Data members:
name[] array to store names of 20 employees.
netsal[] array to store net salary of 20 employees.
Member functions:
void input() to accept names of 20 employees and their
corresponding net salaries.
void selection() to sort the array netsal in
descending order and arrange the names accordingly. Use
selection
sort technique.
void print() to print the sorted data in the following format.
Net
Salary Name
………………………. ……………………….
………………………. ………………………. [15]
Question 5.
Write a program to accept any string:
Count and print the number of pairs of consecutive letters present in words in
the forward direction only. Assume that all the letters in the string are in
the same case, consecutive letters in two different words are not counted and
‘za’ or ‘ZA’ in any word is not a consecutive pair. [15]
For example:
INPUT:
Enter String: ABSTRACT STRING IS
BEING COUNTED EDUCATIONALLY.
OUTPUT:
Pairs of consecutive letter: 3
Qusetion 6.
Write a program to store following numbers in an array and
shift all negative elements of an array to right hand side of the array without
altering the original sequence (without another array). [15]
i.e. if array contains: 5,
-4, 3, -2, 6, -11, 12, -8, 9
Then output will be: 5,
3, 6, 12, 9, -4, -2, -11, -8
Question 7.
Write a menu driven program using function overloading
(the function name is display) to perform the following:
(a) To find the sum of the series up to the limit given by user i.e.
2+3+5+7+11+…………….. [7]
(b) To print the following pattern: [8]
000
001
010
011
100
101
110
111
Question
8.
Write a program to store n number of
state name and its capital in ascending order and then input a state name and
print its capital if it is in the list otherwise print the appropriate message
using binary search. [15]
Question 9.
a) WAP to calculate the sum of the
following series.
S
= ½! -
2/5! - 4/10! + 8/17! – 16/26! –
32/37! + 64/50! ……..n terms
b)
WAP to display the chain of 5
consecutive composite numbers within 1 to 100.
e.g 24, 25, 26, 27, 28
62, 63, 64, 65, 66
great
ReplyDelete