0% found this document useful (0 votes)
23 views

X2324HY

This document contains a half-yearly examination for Class X on the subject of Computer Application. It has two sections. Section A contains 20 multiple choice questions with options a-d. Questions test concepts like encapsulation, wrapper classes, operators, arrays, errors and more. Section B contains 4 out of 7 coding questions to be answered. Questions involve writing programs to calculate interest based on age and term, swapping digits, checking for prime palindromes, character frequency analysis, sorting names by length, and filtering numbers between 100-200 without zeros. The exam is worth a total of 100 marks and students have 2 hours to complete it.

Uploaded by

charlespowel1802
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

X2324HY

This document contains a half-yearly examination for Class X on the subject of Computer Application. It has two sections. Section A contains 20 multiple choice questions with options a-d. Questions test concepts like encapsulation, wrapper classes, operators, arrays, errors and more. Section B contains 4 out of 7 coding questions to be answered. Questions involve writing programs to calculate interest based on age and term, swapping digits, checking for prime palindromes, character frequency analysis, sorting names by length, and filtering numbers between 100-200 without zeros. The exam is worth a total of 100 marks and students have 2 hours to complete it.

Uploaded by

charlespowel1802
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

ABBOT SHISHU HALL

Half Yearly Examination


Session 2023-24
Class – X Computer Application F.M – 100 Time-2 hours
Question 1:
Choose the correct answer and write the correct option. [20 X 1 = 20]
(i) Wrapping up of data and methods together as one unit is known as:
(a) Polymorphism
(b) Encapsulation
(c) Data hiding
(d) Abstraction
(ii) The scanner class is a ______ class.
(a) Primitive
(b) Wrapper
(c) Derived
(d) Super Class
(iii) Math.pow(625, ½) + Math.sqrt(144)
(a) 17.0
(b) 37.0
(c) 13
(d) 13.0
(iv) Multiple branching statement of java is:
(a) for
(b) do…while
(c) switch
(d) while
(v) The number of bytes occupied by the constant 45 are:
(a) Eight bytes
(b) Four bytes
(c) Two bytes
(d) One byte
(vi) Give the output : “SUCCESS”.indexOf(‘S’) + “SUCCESS”.lastIndexOf(‘S’)
(a) 5
(b) 0
(c) -5
(d) 6
(vii) The access modifier that gives least accessibility is:
(a) Private
(b) Protected
(c) Public
(d) Default
(viii) The keyword used to call the package in the program:
(a) extends
(b) import
(c) export
(d) package
(ix) When an object of wrapper class is converted to its corresponding primitive data type, it is called as …
(a) Boxing
(b) Unboxing
(c) Explicit conversion
(d) Implicit conversion
(x) The output of the function “COMPOSITION”.substring(3,6):
(a) POSI
(b) POS
(c) MPO
(d) MPOS
[1] P.T.O
(xi) The logical operation which is an unary operator?
(a) &&
(b) !
(c) ||
(d) >>
(xii) The array int x[10] occupies:
(a) 10 bytes
(b) 20 bytes
(c) 40 bytes
(d) 80 bytes
(xiii) The element in x[4] of the array {3,5,7,12,16,18,20,35,42,89} is:
(a) 16
(b) 7
(c) 12
(d) 18
(xiv) A bug is
(a) Logical error
(b) Syntax error
(c) Runtime error
(d) All of these
(xv) Which of the following operator works with three operands?
(a) Unary
(b) Binary
(c) Ternary
(d) None of these
(xvi) What will be the output of the following code segment? int y=4,x;
for(x=6;x<=24;x=x+6){y--;}System.out.print((x+y)+”,”);
(a) 26,
(b) 24,
(c) 9,14,19,24
(d) 30,
(xvii) Name the error in the statement: double x,y,z;
(a) Logical error
(b) Syntax error
(c) Runtime error
(d) None of these
(xviii) Symbolic constant is
(a) Finalize()
(b) final()
(c) finally()
(d) None of these
(xix) Which keyword causes an immediate exit from the switch case or loop?
(a) continue
(b) jump
(c) break
(d) exit
(xx) Selection sort (Ascending order) work by
(a) Swapping next small value to left
(b) Swapping next small value to right
(c) Finding smallest value and swap first greater value
(d) Finding smallest value and swap any greater value

[2] P.T.O
Question 2
(i) Evaluate the expression: [2]
a + = a++ + -- b + ++a + --b ;
what will be value of y when a =10, b = 5, c = 10.

(ii) Write output of (Math.floor(8.7) + Math.abs(-13)); [2]

(iii) String st = “Suspension per mango”; st.substring(0,2)+ st.substring(11,14)+ st.substring(15,18) =? [2]

(iv) “produce”.compareTo(“product”) – “Greenland".lastIndexOf(‘e’) =? [2]

(v) What will be the output of the following code segment? [2]
public class A {
public static void main(String[] args)
{
System.out.println('j' + 'a' + 'v' + 'a');
}
}
(vi) Find the output:
String ob = "Matrix";
String ob2 = new String(ob);
System.out.println((ob==ob2) + " "+ (ob.equals(ob2))); [2]
(vii) Find the output : [2]
public class Code {
public static void main(String[] args) {
for(int i = 0; i < 1; i++) {
System.out.println(i+' ');
}
}
}
(viii) Why ½ *12.0 will return 0.0? how to get the correct output? [2]
(ix) What is System.exit()? write difference between System.exit(0) and System.exit(1). [2]
(x) How can you find length of a given array m? [2]

Section B (Write any 4)


Question 3 15
A bank announces new rates for term deposit scheme for their customers and senior citizens as given below:
Term Rate of Interest (General) Rate of Interest (Senior Citizen)
Up to 1 year 7.5% 8.0%
Up to 2 years 8.5% 9.0%
Up to 3 years 9.5% 10.0%
More than 3 years 10.0% 11.0%
The ‘senior citizen’ rates are applicable to the customers whose age is 60 years or more. Write a program to accept
the sum (principal) in term deposit scheme, age of the customer and the term. The program displays the information
in the following format:
Output:
Amount Deposited Term Age Interest earned Amount Paid

[3] P.T.O
Question 4 15
Write a program to input a number and swap its maximum digit/digits with minimum digit/digits.
Input: 1153867
output: 8853167

Question 5 15
Write a program to input a multidigit number and check if it is prime-palindrome number or not. Make the number
palindrome by concatenating the reverse of it in case the number is not palindrome and then check if it is prime-
palindrome
[A number which remain same after reversing it, is known as a palindrome number. 121, 232 etc]
Input :131
output: prime palindrome.

Question 6 15
Write a program in java which will input a sentence from user and print frequency of all the character.

Input: Artificial intelligence


Input: a – 2, c-2, e-3, f-1, g-1, i-5, l-3, n-2, r-1, t-2.

Question 7 15
Write a program in java to create an array of n names and sort them as per their size in descending order.
Input: Life is Knowledge
Output: Knowledge Life is

Question 8 15
Write a program to display all the numbers between 100 and 200 which don’t contain zeros at any position.

[4]

|-----END----|

You might also like