0% found this document useful (0 votes)
9 views7 pages

Vms X Preboards Computer

The document is an examination paper for Class X Computer Applications under ICSE, with a maximum score of 100 and a duration of two hours. It is divided into two sections: Section A, which consists of multiple-choice questions, and Section B, which requires students to answer four programming-related questions. The paper covers various topics in Java programming, including functions, control structures, and object-oriented concepts.

Uploaded by

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

Vms X Preboards Computer

The document is an examination paper for Class X Computer Applications under ICSE, with a maximum score of 100 and a duration of two hours. It is divided into two sections: Section A, which consists of multiple-choice questions, and Section B, which requires students to answer four programming-related questions. The paper covers various topics in Java programming, including functions, control structures, and object-oriented concepts.

Uploaded by

barkhamondal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

VIVEKANANDA MISSION SCHOOL

PRE-BOARD EXAMINATION, ICSE - 2025


CLASS-X
SUBJECT - COMPUTER APPLICATIONS

Maximum Marks: 100


Time allowed: Two hours
Answers to thisPaper 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.

Thís Paper is divided into two Sections.


Attempt all questions from Section Aand 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
Question 1: [1x 20 =20]
()To receive an array of size 10 in a function void result() the correct propotype is :
(A)void result (int arr [|)
(B)void result (int arr[10])
(C)void result(arr] int)
(D)Both Aand B

(ii) Arrange the following java statements in the correct order of execution to swap the
values between the two variables a, b.
() a=a-b; (ii) b=a-b; (ii) a= a+b;
(A)), (), (ii) (B) (),(1), (ii) (C) (i), (i),() (D) (ii),(),(1)

(i) Raj wanted to count the number of digits in agiven number without using aloop. Which of
the following statements is correct to perform the above?
(A) String valueOf(n).length (B) String.valueOf(n).length()
(C) Integer.parseInt (n).length() (D) n.length
(iv) Which of the following String methods have at least one integer argument?
() length0 (ii) charAt) (iii) substring0 (iv) indexOf0
(A) (i), (ii) .(iv)
(B) (11), (ii)
(C) (i).(iv)
(D) Allof the above

1
(v) Which of the following is true about java Strings?
(A) Strings are mutable.
(B) Strings can contain only letters.
(C) Strings are implemented as array of characters.
(D) All of the Above
(vi) What is the output of the following code snippet?
int k= 0;
for(; k< 5; k++){
if (k> 2) continue ;}
System.out.printin(k);
(A) 5 (B) 0 (C) 4 (D) Compilation Error

(vii) Find the value of a[1] after execution of the following program.
int] a = {0,2,4,1,3}:
for(int i = 0; i <a.length; i++)
a[i]=a[(a[] +3) %a.length];
(AJ0 (B)1 (C)2 (D)3

(viii) What is the output/Error of the following code ?


int m=100,k=300;
while (m++< k--); System.out.println(m);
(A)200 (B) Error (C)199 (D) 201

(ix) When an object of a Wrapper class is converted to its corresponding primitive data type,
it is called as
(A)Boxing (B) Explicit type conversion ()Unboxing (D)Implicit type conversion
(x) % operator can be applied to
(A) Integers (B) Floating-point numbers (C)Characters (D) All of these
(xi)double x = 6.2;
if(x-- >= 6.0)
System.out.print("irst "):
if(-x >= 5.0)
System.out.print("'second ");
if(X-- >= 4.0)
System.outprint("third ");
else
System.out.print("fourth ");
(A)first second third (B) first second fourth (C)first fourth (D)irst third
(xii)Assertion:Abstraction is the process of exposing the implementation of an object.
2
Abstraction allows you to focus on what an object task. It
does rather than how it is doing the
helps in managing complexity.
A) Both Assertion and Reason are true and Reason is a correct explanation of Asserton.
(B) Both Assertion and Reason are true and Reason is not a correct explanation of Asserdou.
(C)Assertion is true and Reason false
(D)Assertion is false and Reason ftrue
(xii) Find the output/Error of the following code.
int ++a = 100;
System.out.println(++a);
(A) 101 (B) Compilation error (C) 100 (D)102
(xiv) Find the output/ Errorof the following code.
for(int i =0; i<5; i=5 )
System.out.print("Hello");
(A)"Hello" will be printed 5 times (B) "Hello" will be printed 4 times
(C) Compilation Error (D) "Hello" will be printed 1time
(xv) Identify the modifier which cannot be used for constructor.
() public (1) protected (ii)private (iv) static
(A) Only (ii) (B) (ii) .(iv) () (), (i),(iv) (D) Only (iv)
(xvi)

private

default

protected

public

State which access specifier is most restrictive?


(A) private (B) protected (C) default (D) public

(xvii) Find the output/Error of the following code snippet.


float a = 10.0f;
String temp = Float.to String(a):
System.outprintin (temp);
(A) 10.0f (B) 10.0 (C) 10.00 (D) Compilation error
(xvili) Which data type would be the best for storing a student's age in Java?
(A) int (B) byte (C) short (D) long

3
(x0x) The output of the statement Math.ceil(-0.6) +Math.round(-4.5) is
(A) -5.0 (B)-4.0 (C) -3.0 (D) -2.0
(xx) Name the method depicted in the following picture :
6 1 8 5

1 ocollcol L 5
1 5
1 6 5
1 6 5 8
(A)Selection Sort (B) Bubble Sort (C) Linear Search (D)Binary Search

Question 2: [10x2=20]

Write two differences between pure function and impure function.


(i) Write the following expression in java:

(i) What will be the output of the following code snippet :


int] x= {120, 200, 016};
for(int k=0; k<xlength ; k++)
System.out.print(x[k] );

(iv) Convert the following statements into switch case (where O<=n <=100 ):
int n=65;
if (n>= 80)
System/out/printin("Grade A");
else if (n >= 50)
System/out/printin("Grade B");
else
System/out/println("Fail");,
(v) Find the output of the following code snippet:
String Mystr="No@1", newstr="" ;
int count=0;
for(int i=0; i<Mystr.length 0; i++)
{if (count%2 != 0 )
newstr= newstr+count;
else
if(Character.isLowerCase(Mystr.charAt()) )
newstr=newstr + Character.toUpperCase (Mystr.charAt()):
else
newstr=newstr+ Mystr.charAt(i);
count+=1;
)
System.out.printin(newstr) ;
4
Find the output :
System/out/printin("COMPUTER"/charAt(6])+ "COMPUTER"/indexOf(Z)
+ "computer"
/compareTo ("com"));
(i) within
(a)writetheajava statement to print the index of the second occurrence of the letter'1
word "MICHIGAN".
(b) Find the output:
System]out/printin("Rocket")substring(0,4)/compareTo("Rocket"/replace (m''o)}
(vii) Akash has written the following code. It is written to check whether a string is palindrome or
not. However the code is not giving the desired result when parameter is passed to tne
method isPalindrome(. Analyse the following code and answer the following questions:
boolean isPalindrome(String s)

while(true){
if (s.length)>1) return true ;
else if (s.charAt(0) != s.charAt(s.length) -1 )) return false;
S= S.substring(0, s.length -1);
}

(a) What type of error Akash is facing?


b) Find the error/errors and rewrite the correct code.

(ix) Define Encapsulation.


(x) Convert the following code snippet into ternary operator.
if (n%3 == 0) System.out.println("Fizz");
else if (n%5 == 0) System.out.println ("Buzz")
else System.out.printin(n):

Group- B( 60 Marks)
(Answer any four questions from this Section.)
The answers in this section should consist of the programs in either BlueJ environment or any program
environment with java as the base. Each program should be written using variable deseription / mnemonic
codes so that the logic of the program is clearly depicted.

5
Question 3
Define a class Employee with the following :
Class name: Employee
Data Member:
String pan : to store personal account no
String name :to store name
double income: to store annual income
double tax :to store tax that is calculated

Member functions:
void input) : input data members except tax
void cal): calculate tax on annual income on the tax slab given below
void display0 : display the data members
Employee compare(Employee): compare tax between current object and parameterized object and
return the object whose tax is more.
void main0 :create two objects and display the details of the Employee whose tax amount is greater.
Income Tax Slab Tax Rate for Individual
0 to 2,50,000 Nil
2,50,001 to 5,00,000 5% of annual income exceeding 2,50,000
5,00,001 to 10,00,000 12,500 + 20% of annual income exceeding5,00,000
Above 10,00,000 30,000 + 30% of annual income exceeding 10,00,000
Question 4 [15]
Create a class Potential with the following details:
Class Name:Potential
Data Member:
sent:to store asentence in uppercase
Member functions:
Parameterized constructor to initialize the data member.
int calculate(String w): Calculate and return the potentialof a word.
The encryption of letters is to be done as follows:
A=1
B=2
C=3...
Z= 26

The potential of a word is found by adding the encrypted value of the letters. Example: LOOK
Potential =12 + 15+ 15+11 =53

boolean isPrime(intx) : return true if xis prime otherwise false.


void check() : Extract the words from the sentence sent and store them in an array. Display those
words from the array where potential is a prime number.
void main0 : create object and call the method/methods to accomplish the following task.
Example : Input: LOOK BEFORE YOULEAP Output: LOOK YOU
6
on 5 [15]
Ngna class to overload afunction print() as follows:
oid print(lint m, int n):
Print all the Ugly numbers betweenm and n(both inclusive).
The ugly numbers are positive numbers whose only prime factors are 2, 3 or 5.
Few ugly numbers are 10, 12,30.

void print(int n): Print the following pattern if nis odd.


For n = 5the pattern is
12345
234
3
234
12345

Ouestion6 [15]
opposite case then
() Write a program to input a word and decode it by replacing each letter into
by the next character in a circular way. e.g. AbZ will be bCa
odd or not. If it is odd
() Write a program to input a word in uppercase and check its length is
then print the following pattern.
For the word "CROWN" the pattern will be.

ROW
CROWN

[15]
Question7
in ascending order. Inputa
Write aprogram to initialize an integer array of size 6 where the elements are If the number is present
number and check the number is present in the array or not using binary search.
then remnove the element from the array and rearrange the array.

Initial Array: |10 20 3040 5060


Enter a no.to remove : 40
Rearranged Array: 1020 30 50 600

Ouestion 8 [15]
array consists of 4 rows and
Write a program to input integersas elements in a two dimension find and display
4 columns. Find and display index of the row whose sum is maximum. Also
index of the column whose product is minimum.

You might also like