0% found this document useful (0 votes)
3 views8 pages

PracticePaper1 Computer icse

,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

Uploaded by

suchitra ganta
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views8 pages

PracticePaper1 Computer icse

,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

Uploaded by

suchitra ganta
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

SECOND PREBOARD – JANUARY 2026

COMPUTER APPLICATIONS
CLASS : X Max Marks: 100 DATE : 23/01/2026
Duration: 2 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.
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 [ ].
SECTION A(40 Marks)
(Attempt all questions from this section)
Question 1 [20]
(i) A library management system stores book details such as bookId, title, and price.
These data members are declared as private. Access to these details is provided only through
public methods like getPrice( ) and setPrice( ), which also ensure that invalid values are not
assigned. (a) Polymorphism
(b) Abstraction
(c) Encapsulation
(d) Inheritance

Which OOP principle is illustrated in this scenario?


(ii) Consider the following segment:
(a) Boxing , output :75.5
(b) Autoboxing , output :100.0
(c) Unboxing , output :100.0
(d) Type casting, output :75.5

Double d=75.5;
double val=d;
[Link] (val+24.5 );
What process is being processed and what will be the output?
(iii)What is the output of the following statement?
(a) q
(b) Q
(c) 1
(d) 0

[Link]([Link](‘q’));
(iv) What is the output of the code snippet given below?
(a) 3 3.0
(b) 3.0 3.5
(c) 3 3.5
(d) 3.5 3.0

int a=7,b=2;
float z=7f/2
[Link] (a/b+” “+z);
(v) A data member of a class that carries a single shared value for all the objects of a class
is called
(a) class variable
(b) Static variable
(c) Instance variable
(d) Both (a) and (b)

(vi) Identify the non-static method.


(a) nextInt()
(b) max(int, int)
(c) isLetter(char)
(d) random( )

(vii) What is the output of the code snippet given below?


(a) 369
(b) 963
(c) 0
(d) 3

int i;
for( i=3; i>9 ; i+=2);
[Link] (i);
(viii) Which of the following is correct to invoke the method given below? (a) int x = find
(10);
(b) double x = find (10);
(c) double x = find (10.0);
(d) double x = find ( );

public static double find (int a)


(ix) Assertion (A): Each primitive data type belongs to a specific wrapper class. (a) Both
Assertion (A) and Reason (R) are true and Reason (R) is a correct explanation of Assertion (A)
(b) Both Assertion (A) and Reason (R) are true and Reason (R) is not a correct
explanation of Assertion (A)
(c) Assertion (A) is true and Reason (R) is false
(d) Assertion (A) is false and Reason (R) is true

Reason (R): Each primitive data type of Java such as int, float, etc., is wrapped by a
corresponding wrapper class that provides methods to operate on the data.
(x) Predict the output for the following (a) ThreeDuplicate
(b) Compile time error
(c) Three
(d) Runtime error

int n = 3;
switch(n)
{
case 1:
[Link]("One");
break;
case 3:
[Link]("Three");
break;
case 3:
[Link]("Duplicate");
break;
default:
[Link]("Other");
}
(xi) Arrays are (a) Mutable at any index
(b) Mutable at first and last index
(c) Non-mutable
(d) Mutable only if they are string

(xii) Which access specifier allows access within the same package and by subclasses in
other packages? (a) private
(b) protected
(c) public
(d) default
(xiii) Select the appropriate Java expression to calculate the square root of the product of
72 and 19. (a) [Link](72) + 19
(b) 72 * [Link]( 19)
(c) [Link](72*19, 1.0/2)
(d) [Link](72) + [Link](19)

(xiv) Predict the output for the following


(a) a = 0, b = 2
(b) a = 2, b = 0
(c) a = -2, b = 0
(d) a = 1, b = 0

int a = 2, b = -10, c = -2;


a += b %= c;
[Link] (-a +" "+b);
(xv) Predict the output for the following
(a) 10.0
(b) 12.0
(c) 216.0
(d) 625.0

int a[]={5,6,8,4,3,10,-1,-2};
a[1]=2; a[6]= -4;
double m=[Link](arr[1],arr[4])+[Link](a[3],a[6]);
[Link](m);
(xvi) Write the output of the following code.
(a) Compile time error
(b) false
(c) runtime error
(d) null

public static void display()


{ String s;
[Link]( s ); }
(xvii) The output of [Link](-2> = -3 ? 63/9%7 : -3*-2);
(a) 6
(b) -6
(c) 0
(d) 2

(xviii) String s=”Computer Application”;


(a) -1
(b) 0
(c) 7
(d) No output

[Link]([Link](‘ ‘) - [Link](‘ ’); Page 5 of 8


(xix) Which of the following return statement is wrong? (a) return 0
(b) return true
(c) return s,p
(d) return p

(xx) What is the result of the below statement if (a) true


(b) false
(c) 0
(d) 1

int a=5,b=10,c=1;
boolean d=!(a>0||a>b&& !(b<c))

Question 2
(i) Fill in the blanks to complete the code to get the output as shown below: [2]

for( int c = 65; c <=71;_____(a)____)


[Link](________(b)_______ + " ");
The expected output for the code is:
ACEG
(ii) Write a Java expression for [2]

37√a2+b2
(iii)Give the output for the following method: [2]

int[] a = {5, 10, 15};


int i = 0;
int x = ++a[i] + a[i++] + a[++i];
[Link](x);

(iv) Rohit wants to perform a type conversion from double to int to display the integer part of a
decimal number. However, the following code shows an error. State the type of the error, write
the correct statement: [2]

double num = 45.78;


int value = num;
[Link]("Integer part: " + value);
(v) Write the number of bytes occupied by the following arrays. [2]

(a) char x[20]


(b) int a[4][2]
(vi) Give the output of following String function [2]

(a) “[Link](“GRAM”)
(b)”CABLE”.compareTo(“CADET”);
(vii) How many times the following loop execute? Write the output for the following code. [2]
char x=’P’;

while (x<= ‘T’)


{
[Link](x++ +” ”);
if(x==’R’)
break;
++x;
}
(viii) Convert the following for loop segment to an exit-controlled loop. [2]

for(int b=2,a=100;b<=30;b=b+5)
{
[Link](b+a);
a=a+2;
}
(ix) Name the following: [2]
(a) A String method to remove all leading and trailing space in a string .
(b) A sort method in which consecutive elements are NOT compared.
(x) Consider the following code and give the output of the following code: [2]

class Maximum{
int x,y;
Maximum()
{
x=10; y=8;
}
Maximum(int a, int b)
{
x=a; y=b;
}
void display( )
{
[Link] ([Link](x,y));
}
public static void main( )
{
Maximum m=new Maximum( );
[Link]();
Maximum p=new Maximum(-7,-25);
[Link]();
}
SECTION B (60 Marks)
Attempt any FOUR questions from this Section.
The answers in this section should consist of the programs in either Blue J environment or any
program environment with Java as the base.
Each program should be written using Variable descriptions/Mnemonic codes so that the logic of the
program is clearly depicted.
Flow-charts and algorithms are not required.
Question 3 [15]
Design a class with the following specifications:
Class name: OnlineOrder
Data Members:
String name - to store the customer's name.
double orderAmt - to store the total amount of the items ordered in the cart.
char type - to store the delivery type:
‘S’ for Standard delivery
‘E’ for Express delivery
double totalAmt - to calculate and store the total amount paid.
void input( ) - to input values for all the member variables using Scanner class methods only.
void calculate( ) - to calculate the total payable amount as follows:
GST at 18% of orderAmt
Delivery charges:
• • Rs 40 for Standard delivery
• • Rs 100 for Express delivery

totalAmt = orderAmt + GST + delivery charge


void display( )- displays the details in the following format.
Name of consumer Ordered Amount Total Amount
--------------------- -------------------- -----------------
Write the main method to create an object and call the above methods.
Question 4 [15]
Define a class to accept a string and Convert to uppercase. Encode the string by replacing each
vowel by the next character and every Consonant by the previous character. Display the output in
the format shown below.
Input: COMPUTER
Output:
Input String Encoded String
COMPUTER BPLOVSFQ
Question 5 [15]
Write a program in Java to input ‘n’ integers in a one-dimensional array (in ascending order).
Then, input an element to be searched using the binary search technique and display whether it
is present in the array or not, along with its position (index). Page 8 of 8
Question 6 [15]
Define a class to accept integer values in 3x 3 array and check whether it is a Sparse matrix or
not .Also print the original array .
A matrix is called a sparse matrix if most of the elements in that matrix is [Link],count of zero
elements present in the array must be greater than the total number of elements in the array
Example
Input
003
000
400
Output
It is a sparse matrix
Question 7 [15]
Define a class to overload the method perform() as follows:-

volume=23𝜋𝑟3
public void perform (double r) – calculate and display the volume of a hemisphere.

public void perform() – display the following pattern using nested for loop.
1
##
333
####
55555
######
7777777
public void performs (char a) - check and display the message "It is a special character" if the
character in ‘a’ is neither a letter nor a digit. Otherwise, display "It is not a special character".
Question 8 [15]
Write a program to input two integer numbers and check if they are Amicable numbers or not.
Amicable numbers are two numbers such that the sum of the proper divisors (excluding the
number itself) of each number is equal to the other number.
Examples: 220 and 284 are amicable number
Proper divisors of 220: 1, 2, 4, 5, 10, 11, 20, 22, 44, 55, 110
Sum = 1 + 2 + 4 + 5 + 10 + 11 + 20 + 22 + 44 + 55 + 110 = 284
Proper divisors of 284: 1, 2, 4, 71, 142
Sum = 1 + 2 + 4 + 71 + 142 = 220
Thus, 220 and 284 is a pair of amicable number

You might also like