X Computer Pre Board I
X Computer Pre Board I
School Baghpat
Pre Board Examination
Subject - Computer Applications
Class – X
TIME – 2 hours M.M.-80
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 [ ].
SECTION A (40 Marks)
Attempt all questions
Question 1 [20]
(i) A method can return ………
(a) 1 value (b) 2 values (c) 3 values (d) any number of values
(ii) In Java a constructor with no parameter is called a
(a)Default constructor (b)user defined constructor
(c)custom constructor (d)static constructor
(iii) Private function is accessible to......
(a)Own class only (b)sub class and class in the same package
(c)subclass (d)none of these.
(iv) Function prototype means
(a)Return value of a function (b)Name of a function
(c)Return type of a function (d)Return type, name and argument of a function.
(v) Which of the following represent the constructor of the ABC class
(a)ABC() (b)ABC (c)ABCconstructor (d)Constructor ABC ()
(vi) What is the return type of indexOf() function of string class?
(a)char (b) String (c)boolean (d)int
(vii) The ability of a method or object to take on multiple forms is called.
(a) abstraction (b) encapsulation (c)inheritance (d)polymorphism
(viii) Which of the following is a keyword?
(a) token (b) continue (c) constant (d) all of these
(ix) Name the method used to convert String value into int?
(a) ParseInt() (b) parseInt (c) parseInteger (d) none of these
(x) The ……… allows a class to use property of another class.
(a) Encapsulation (b) Abstraction (c) inheritance (d) None of these
(xi) The ……… operator is used to access method of a class.
(a) Object (b) new (c) (.)dot (d) import
(xii) The statement System.out.println(1+2+“four ”+2+5); gives the output………
(a)3 four 5 (b)3 four 23 (c) 12 four 23 (d) error
(xiii) x + = x++ + --x + --x + x; [ x = 5 ]
(a) 23 (b) 20 (c) 18 (d) none of these
(xiv) Math.pow(Math.ceil(4.22), Math.cbrt(8));
(a) 16 (b) 25 (c) 25.0 (d)16.0
(xv) Consider the following String array and give the output:
String arr[ ]={"Java", "PHP", "Python", ".Net", "HTML"};
System.out.print( arr[2].charAt(2)+” “+arr[3].indexOf(‘N’));
(a) h -1 (b) H 1 (c) t 1 (d) Runtime Error
(xvi) Predict the output of the following statement:
String wd[ ] = {"INDIA", "USA", "NEPAL", "GERMANY", "MEXICO"};
System.out.println(wd[2].substring(0,3) + wd[4].substring(4));
(a) USANY (b) MEXPAL (c) NEPCO (d) INDNY
(xvii) The return data type of Integer.parseInt( ) method is ________ .
(a) String (b) int (c) void (d) Integer
(xviii) Which of the following is not a type of inheritance?
(a) multiple (b) double (c) hybrid (d) single
(xix) Corresponding wrapper class of the char data type is?
(a) String (b) Character (c) Char (d) CHARACTER
(xx) The process to change one data type value to another data type is known as
(a)Declaration (b)Type conversion (c) Converting data type (d)Initialising data type
Question 2
(i) Define method overloading?
(ii) Write an expression in Java for
√3 a+b – b
3a
(iii) State any two differences between user defined data type and primitive data type?
(iv) What is the difference between class variable and instance variable?
int x =20, y = 10, z;
What is the value of x, y, z in
z = ++x * (y – –) %4 – y++*4/--x
Show the steps.
(v) What is the purpose of default in a switch?
(vi) What will be the output of the following code?
String s = “Java is Best”;
System.out.println(s.indexOf(‘A’))
System.out.println(s.charAt(5)+5)
Question 5
Write a menu driven program to calculate sum of digits of a number and sum of factors of a
number depending upon users choice.
Question 6
Write a program that accept a word and check if it is palindrome or just a special word. Hint A
Palindrome word is which reads the same backward and forward. Example MADAM, LEVEL etc.
Special words are which starts and ends with same character, example COMIC, ATLANTA etc.
Question 7
Write a program that input and store monthly salary of 50 employees in an array and perform
following task.
* Print the highest salary.
* Calculate and print sum and average of salary.
* Count how many employees are taking more than 5 lakh salary per annum.
Question 8
Write a program to sort the given array in descending order using bubble sort technique.
15,25,41,68,92,55,48,21,74,19