0% found this document useful (0 votes)
22 views6 pages

PreBoard 02

The document is a pre-board examination paper for Class X Computer Applications at Christu Jyoti Convent Sr. Sec. School, Baghpat. It consists of two sections: Section A with multiple-choice questions and Section B requiring programming tasks. Students must attempt all questions from Section A and any four from Section B, with a total of 80 marks available.

Uploaded by

shauryadeep69
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)
22 views6 pages

PreBoard 02

The document is a pre-board examination paper for Class X Computer Applications at Christu Jyoti Convent Sr. Sec. School, Baghpat. It consists of two sections: Section A with multiple-choice questions and Section B requiring programming tasks. Students must attempt all questions from Section A and any four from Section B, with a total of 80 marks available.

Uploaded by

shauryadeep69
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/ 6

Christu Jyoti Convent Sr. Sec.

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 [20x1=20]

Choose the correct answers to the questions from the given options.
(Do not copy the question, write the correct answers only.)

I. Name the feature of java depicted in the picture below.

(a)Inheritance (b) Polymorphism (c) Encapsulation(d) Abstraction


II. The datatype which is specified that the method does not return a value is:
(a)Void (b) void (c) VOID (d) Boolean
III. The logical operator which is an unary operator:
(a)&& (b)|| (c) ! (d)>>
IV. Math.pow(625, 0.5 ) - Math.sqrt(144)
(a)17.0 (b) 13.0 (c)37.0 (d) 13
V. Multiple branching statement of java is:
(a) for (b) while (c) do... while (d) switch
VI. What is the output of the following code?
int arr[ ][ ] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
System.out.println(arr[1][0]+arr[0][2]+arr.length);
(a)10 (b) 7 (c)12 (d) 6
VII. while loop is an
(a) entry controlled loop (b) infinite loop (c) exit controlled loop (d) Finite loop
VIII. How many times the inner loop is executed?
for(k=1;k<=3;k++)
{
for(m=1;m<=5;m++)
{
System.out.println(m*2);
}
}
(a) 4 times (b) 8 times (c) 10 times (d) 15 times
IX. A method with the same name as of the class and with arguments and no return data type is
termed as:
(a) parameterized constructor (b) default constructor
(c) Non — parameterized constructor (d) wrapper class method
X. int res=’A’+5; What is the value of res?
(a) A (b) F (c) 70 (d) syntax error
XI. The element in x[10] of the array (3, 5, 7, 12, 16, 18, 20, 35, 42, 89} is:
(a) 16 (b) 12 (c) 7 (d) run time error
XII. The style of expressing single line comment is:
(a) /* comment*/ (b) /** comment*/ (c) // comment (d) /* comment
XIII. The method to check if a character is an alphabet or not is:
(a) isLetter(char) (b) isAlpha(char) (c) isUppercase(char) (d) isLowercase(char)
XIV. Assertion: In Java, arrays can hold different types of data in a single array.
Reason: In Java, arrays are homogeneous, meaning they can only hold values of the same type.
(a) Both Assertion and Reason are true, and the Reason is the correct explanation for Assertion.
(b) Both Assertion and Reason are true, but the Reason is not the correct explanation for
Assertion.
(c) The Assertion is true, but the Reason is false.
(d) The Assertion is false, but the Reason is true.
XV. Assertion: An identifier in Java can be a combination of letters, digits, and special characters
like $ or _.
Reason: Identifiers cannot start with a digit but can contain digits after the first character.
(a) Both Assertion and Reason are true, and the Reason is the correct explanation for Assertion.
(b) Both Assertion and Reason are true, but the Reason is not the correct explanation for
Assertion.
(c) The Assertion is true, but the Reason is false.
(d) The Assertion is false, but the Reason is true.
XVI. The output of Double.parseDouble(“71.25”) +0.75 is:
(a) 72 (b) 72.0 (c) 71.0 (d) 71.75
XVII. The method to convert a string to upper case is:
(a) toUpperCase(char) (b) toUPPERCASE(String)
(c) toUpperCase(String) (d) touppercase(String)
XVIII. String str = "Computer Science";
System.out.println(str.substring(3, 10));
(a) mputer S (b) puter Sc (c) Comput (d) puter Sci
XIX. The array double x[10] occupies:
(a) 10 bytes (b) 40 bytes (c) 20 bytes (d) 80 bytes
XX. Name the type of error that occurs for the following statement:
System.out.println(10/0);
(a) Syntax error (b) run time error (c) logical error (d) no error

Question 2 [10x2=20]
I. What is the difference between static variable and non-static variable?
II. What do you mean by comments? What are the different types of comment supported by java?
III. Differentiate between break and return statements.
IV. What will be the output of the following code?
int a[ ] = {5, -1, 2, 9, 14, -6, 25};
System.out.println(Math.max(a.length,a[5]));
System.out.println((int)Math.sqrt(a[3]+a[6]));
V. What will be the output of the following program segment?
String s1 = “Application”,s2=”Computer”;
System.out.println(s1.substring(0,4)+s2.charAt(6));
System.out.println(s2.length()+s1.indexOf(‘e’));
𝑥1+𝑥2 𝑦1+𝑦2
+
2 2
VI. Write an expression in Java for 𝑥1+𝑦1
VII. Give the output of the following java statements:
"UppErCasE LettEr".toUpperCase().substring(5);
"Arun".compareTo("Arpan");
VIII. Write the statements for the following:
(a) Create an array to store ‘n’ double values.
(b) Assign the value 20.22 at the last index of the array.
IX. What is the value of m and n after evaluating the following expression:
m = 6*--n%++n + ++n/2 + n--; when int n=5;
X. Predict output of the following:
for (int i = 0; i < 4; i++)
{
for (int j = 0; j < i; j++)
{
System.out.print(i + " " + j + " ");
}
}

SECTION B
(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 description / mnemonic codes so that the logic of the
program is clearly depicted.
Flowcharts and algorithms are not required.

Question 3 [10]

Define a class with the following specifications:


Class name: employee
Member variables:
eno — employee number
ename — name of the employee
age — age of the employee
basic — basic salary
[Declare the variables using appropriate data types]
Member methods:
employee() – default constructor.
void accept() — to accept the details using scanner class.
void calculate () — to calculate the net salary as per the given specifications:

net = basic + hra + da — pf


hra = 18.5 % of basic
da = 30 % of basic
pf= 8.25 % of basic.

If the age of the employee is above 50 he/she gets an additional allowance of Rs.5000.
void print() — to print the details as per the following format
eno ename age basic net
---------- ------------ --------- ---------- ----------

void main() — to create an object of the class and invoke the methods.

Question 4 [10]

Define a class to overload the method print as follows:


void print () — to print the format

2 3

4 5 6

7 8 9 10

void print (int n) — to print sum of the digits of n.


void print (int n, char ch) —if ch = ‘s’ or ‘S’ print the square of the number n else if ch = ‘c’ or ‘C’ print
the cube of the number n.

Question 5. [10]
Define a class to accept values into a double array of length 20 and perform the following task
(i) Print array elements.
(ii) Print range of the array, range is the difference between the largest and the smallest elements of
the array.
(iii) Print sum of elements.

Question 6 [10]
Whole numbers are said to be abundant, deficient, or perfect. A whole number is abundant if the sum
of its proper divisors is greater than the whole number. The whole number 12 is abundant. Its proper
divisors are 1, 2, 3, 4, and 6 and the sum of the proper divisors is 16 which is greater than 12. A whole
number is deficient if the sum of its proper divisors is less than the whole number. The number 4 is
deficient. Its proper divisors are 1 and 2 and the sum of its proper divisors is 3 which is less than 4. A
whole number is perfect if the sum of its proper divisors is equal to the whole number. The number 6 is
perfect. Its proper divisors are 1, 2, and 3 and the sum of its proper divisors is 6.
Write a program to check whether the number entered by user is perfect, deficient or abundant.
Question 7 [10]

Define a class to accept a string, convert it in upper case and encode the string in the following format:
if the character is a vowel, then replace it with the next character. Other character will remain same.
Also count the number of vowels present in it.
Example : input = “BeaUTiFul”
Output — “BFBVTJFVL”.
No. of vowels = 5

Question 8 [10]

Write a program to input numbers into a 4x4 2 D array and print this 2D array in matrix form along
with sum of each row separately.
Example :

Input: 3 5 7 14
9 3 11 5
6 -2 3 7
-1 3 -1 7
output : Array elements Sum
3 5 7 14 29
9 3 11 5 28
6 -2 3 7 14
-1 3 -1 7 8

You might also like