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

Cl. 10_pre Board_computer Applications (Set-A)

Uploaded by

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

Cl. 10_pre Board_computer Applications (Set-A)

Uploaded by

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

DELHI PUBLIC SCHOOL NEWTOWN

SESSION: 2023-2024
PRE BOARD EXAMINATION

CLASS: X FULL MARKS: 100


SUBJECT: COMPUTER APPLICATIONS [SET A] TIME: 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.
This paper consist of five printed pages. 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 from this Section)
Question 1: Choose the correct answer and write the correct option: [1x20=20]
(i) Instance variables are also considered as:
(a) objects and attributes (b) class variables (c) method (d) behaviour
(ii) Predict the output, assuming that the method is called and 8.6 is passed as the value of x:
static double cal(double x)
{ return Math.round(x); }
(a) 8 (b) 8.0 (c) 9 (d) 9.0
(iii) Function prototype refers to:
(a) function name, parameter list and its data type (b) parameter list and its data type
(c) function name (d) return type, function name, parameter list and its data type
(iv) Character ch= ‘A’; Choose the right term to explain the given statement:
(a) autoboxing (b) packing (c) unboxing (d) unpacking
(v) Scope of _____ access modifier is limited only within the same class.
(a) final (b) protected (c) private (d) public
(vi) Real life example of class and object is:
(a) mobile nokia, iphone, samsung (b) iphone 11, iphone 12, iphone 13
(c) PC desktop, laptop (d) both a and c
(vii) If you want to limit the scope of the variables only within a particular method, which type
variable you would prefer to use?
(a) dynamic variable (b) local variable (c) class variable (d) instance variable
(viii) Given an array: int a[ ][ ] = { { 0,9 }, { 2,3 } }; What will be the product of even elements?
(a) 0 (b) 6 (c) 2 (d) 8
(ix) Assertion(A): Selection sort in java is a comparison based sorting algorithm.
Reason(R): Selection sort technique involves choosing the arrays smallest element and swapping it
with the arrays last element while arranging smallest to largest.
(a) Both Assertion (A) and Reason (R) are true and (R) is a correct explanation of (A)
(b) Both Assertion (A) and Reason (R) are true and (R) is not a correct explanation of (A)
(c) Assertion (A) is true and Reason (R) is false
(d) Assertion (A) is false and Reason(R) is true
1
(x) Which concepts of java is shown in the given picture from 1 to 4?

(a) encapsulation, polymorphism, inheritance, abstraction


(b) polymorphism, inheritance, abstraction, encapsulation
(c) abstraction, encapsulation, inheritance, polymorphism
(d) inheritance, polymorphism, abstraction, encapsulation
(xi) Which of the following is used to start a single line comment:
(a) // (b) /* (c) /** (d) any one of them
(xii) In a nested loop structure, which loop is executed the most number of times?
(a) Outer loop (b) Both loops are executed same number of times
(c) Inner loop (d) cannot be determined without knowing the size of the loop
(xiii) Ashok need to write a program for preparing bill in his shop. He is aware of the fact that
the number of customers on any particular day is not known beforehand. Which loop should be
ideally used in the program to create the bill for the entire day?
(a) for loop (b) while loop (c) do while loop (d) b or c
(xiv) In which of the following ways, the actual parameter and the formal parameter share the same
location in the memory?
(a) pass by reference (b) pass by value (c) pure method (d) both a and b
(xv) Assertion(A): The value of the static variable is shared by all the objects of the class.
Reason(R): The objects cannot change the value of static variables.
(a) Both Assertion (A) and Reason (R) are true and (R) is a correct explanation of (A)
(b) Both Assertion (A) and Reason (R) are true and (R) is not a correct explanation of (A)
(c) Assertion (A) is true and Reason (R) is false
(d) Assertion (A) is false and Reason(R) is true
(xvi) A constructor in Java is a special method that is used to initialize objects. The constructor is
called when an object of a class is created. It can be used to set initial values for object attributes.
Based on the above discussion, answer the following:
A _____ constructor is used to initialise instance variables automatically with default values.
(a) copy (b) non-parameterised (c) parameterised (d) default
(xvii) Considering the following code, predict the final value of a:
int ar1[ ] = { 1, 2, 3, 4, 5 }; int a=1;
for(int i=0;i<5;i++)
{ a=a+i*ar1[i]; }
System.out.println(a);
(a) 35 (b) 50 (c) 0 (d) 41

2
(xviii) What will happen if the test condition given in the outer loop evaluates to false?
(a) Inner loop will execute (b) neither inner nor outer loop will execute
(c) outer loop will execute (d) outer loop will not execute, inner loop will execute
(xix) Which type of error occurs in the following statement:
System.out.println(Math.pow(0,-1));
(a) runtime error (b) logical error (c) syntax error (d) no error
(xx) The array double x[10] occupies:
(a) 40 bytes (b) 80 bytes (c) 20 bytes (d) 10 bytes

Question 2: [2x10=20]
(i) Evaluate:
(a) Character.isUpperCase(Character.toLowerCase(‘A’));
(b) System.out.println(“RocKet”.substring(2) + “rock”.replace(‘t’, ‘I’));
(ii) Predict the output:-
if(Math.ceil(2.5) > Math.abs(-6.5))
System.out.println(Math.floor(4.5)+5);
else System.out.println(Math.max(4.5,-5));

(iii) Write the java expression: √𝟑𝒂𝟐 + √𝟒𝒙𝒚 − 𝒃𝟐


(iv) Predict the output and also specify the number of times the loop will execute in the given code:
int x= 2538;
while(x!=0)
{ int y=x%100;
System.out.println(y);
x=x/10; }
(v) Write the equivalent code using if else construct:
char ch= ‘a’;
switch(ch)
{ case ‘A’:
case ‘a’: System.out.println(“kolkata”); break;
case ‘B’:
case ‘b’: System.out.println(“Delhi”); break;
default: System.out.println(“wrong input”); }
(vi) Write the pre-defined methods to perform the following:
(a) checks whether a character is a space or not
(b) converts string to float
(vii) Predict the output of the following code:
String s1=”strength”; String s2=”Assignment”;
System.out.println(s1.indexOf(s2.charAt(3)));
System.out.println(s1.substring(0,4)+s2.substring(1,3).length());
(viii) Sam wants to print the following pattern. He designed the code but the code is not giving the
correct output. What are the changes required to correct the code in achieving the output?
54321
4321
321
21
1
3
public class Star {
public static void main(String[] args) {
int rows = 5;
for(int i = rows; i >= 1; --i) { //For Loop for Row
for(int j = 1; j <= i; --j) { //For Loop for Col
System.out.print(i); } //Prints
System.out.println(); }}} //Get to newline
(ix) Evaluate the expression, if int a=6, b= -5:
double c= (++a % --b) * a + 1.0/2.0 * b++;
(x) How is length and length( ) function different?

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

Question 3 [15]
A bank announces new rates for Term Deposit Schemes 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
10.0% 11.0%
years
The 'senior citizen' rates are applicable to the customers whose age is 60 years or more. Write a
program to accept the sum (p) in term deposit scheme, age of the customer and the term. The
program displays the information in the following format:
Amount Deposited Term Age Interest earned Amount Paid
xxx xxx xxx xxx xxx

Question 4 [15]
Write a program to accept a number and arrange the digits of the number in descending order.
Example: Sample Input: 486290
Sample Output: 986420

Question 5 [15]
Write a program to accept a string and check if it makes a strong password. A strong password
should have at least 8 characters with one uppercase character, one lowercase character, one digit
and one special character.

4
Question 6 [15]
A double dimensional array is defined as N[4][4] to store numbers. Write a program to find the sum
of all even numbers and product of all odd numbers of the elements stored in Double Dimensional
Array (DDA).
Sample Input:
1057
3926
5493
4341
Sample Output:
Sum of all even numbers: 20
Product of all odd numbers: 46

Question 7 [15]
Design a class overloading a method calculate( ) as follows:
1. void calculate(int m, char ch) with one integer argument and one character argument. It checks
whether the integer argument is divisible by 7 or not, if ch is 's', otherwise, it checks whether the
last digit of the integer argument is 7 or not.
2. void calculate(int a, int b, char ch) with two integer arguments and one character argument. It
displays the greater of integer arguments if ch is 'g' otherwise, it displays the smaller of integer
arguments.
3. void calculate(String str, int p) with one String argument and one integer argument. It displays
all the uppercase characters if 'p' is 1 (one) otherwise, it displays all the lowercase characters.

Question 8 [15]
The annual examination result of 50 students in a class is tabulated in a Single Dimensional Array
(SDA) is as follows:

Roll No. Subject A Subject B Subject C

....... ....... ....... .......

....... ....... ....... .......


Write a program to read the data, calculate and display the following:
(a) Average marks obtained by each student.
(b) Print the roll number and the average marks of the students whose average is above. 80.
(c) Print the roll number and the average marks of the students whose average is below 40.
5

You might also like