VIVEKANANDA MISSION SCHOOL, HALDIA
Pre – Board Examination (2024 – 2025)
Class:- X Subject:- Computer Applications (Gr-III) F.M.:-100 Date: - 17.01.2025
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
(Attempt all questions from this Section.)
Question 1 [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 oop’s concept that the above picture depicts
(a) Encapsulation
(b) Polymorphism
(c) Inheritance
(d) Abstraction
(ii) Which component is used to compile, debug and execute the java programs?
(a) JRE
(b) JIT
(c) JVM
(d) JDK
(iii) What is the output of the following expression?
int a = 42; double b = 42.25;
System.out.println((a%10)+ “ ”+(b%10));
(a) 2 42.5
(b) 42 4.25
(c) 2 2.25
(d) 2 2.5
(iv) What is the value of the expression 5+2 = = 7 && 4>3 in java?
(a) 1
(b) true
(c) 0
(d) false
Page 1 of 8
(v) Which of the following is a valid method prototype?
(a) public int perform (int a;int b)
(b) public perform (int a, int b)
(c) public int perform (int a, int b)
(d) public perform int (int a, int b)
(vi) The output of the following code is:
System.out.println(Math.ceil(4.5) + Math.round(4.5));
(a) 10.0
(b) 10
(c) 9
(d) 9.0
(vii) Which of the following returns a character?
(a) “xyz”.indexOf(‘x’)
(b) “xyz”.replace(‘x’,’y’)
(c) “xyz”.charAt(0)
(d) “xyz”.length()
(viii) Miss. Priyashi is an event manager, she plans and allots duties to each of her subordinates to
handle different events. In a program, a task is divided into simple methods. Name the feature
used in these contexts.
(a) Complexity
(b) Modularity
(c) Reusability
(d) Monolithic
(ix) Consider the statement given below:
char a[]={‘0’,’1’,’2’,’3’,’4’,’5’};
int c=(int)(( a[2] - 48)*10);
What will be the value stored in c?
(a) 20
(b) - 460
(c) ‘2’-48
(d) error
(x) To print the 02468 which of the following is correct?
(a) for(int i=1;i<=10;i+=2) {System.out.print(i);}
(b) for(int i=2;i>=10;i+=2){System.out.print(i);}
(c) for(int i=0;i<10;i+=2){System.out.print(i);}
(d) for(int i=10i>=2;i-=2){System.out.print(i);}
(xi) What will be the output of the following java code?
char array_variable [ ] = new char[10];
for (int i = 0; i < 10; ++i)
{
array_variable[i] = 'i';
System.out.print(array_variable[i] + " "); }
Page 2 of 8
(a) 1 2 3 4 5 6 7 8 9 10
(b) 0 1 2 3 4 5 6 7 8 9 10
(c) ijklmnopqr
(d) iiiiiiiiii
(xii) What is the correct syntax to call a method named “myMethod” from an object “myobject”?
(a) myobject.myMethod();
(b) myMethod.myobject();
(c) myMethod();
(d) myobject.myMethod;
(xiii) What is the default size of boolean data type?
(a) 2 bytes
(b) 1 byte
(c) 1 bit
(d) 2 bits
(xiv) Which of the following is not a valid jump statement?
(a) break
(b) return
(c) continue
(d) goto
(xv) What is the return type of the function isDigit(Char)?
(a) boolean
(b) int
(c) char
(d) String
(xvi) Assertion: A class can have multiple constructors.
Reason: Multiple constructors are defined with same set of arguments.
(a) Assertion is true, Reason is false.
(b) Both assertion and Reason are false.
(c) Both assertion and Reason are true.
(d) Assertion is false, Reason is true.
(xvii) Which of the following is the CORRECT statement to invoke the method with the prototype int
display(int a, char ch)?
(a) int m = display(45,‘A’);
(b) int m = display(‘A’, 45);
(c) int m = display( );
(d) int m = display(A,45);
(xviii) The character class which checks whether a character given as argument is a blank
space or not:
(a) Character.isBlankSpace(ch)
(b) Character.toBlankSpace()
(c) Character.isWhiteSpace(ch)
(d) Character.hasWhiteSpace(ch)
Page 3 of 8
(xix) Consider the following program segment in which the statements are jumbled, choose the
correct order of statements to search for a given element using linear search technique.
void Lsearch(int a[], int b) {
int f = 0; (1)
if(b = = a[i] ) (2)
for(int i=0; i<a.length; i++)(3)
{
f = 1;
break}}(4)
(a) (1) (2) (3) (4)
(b) (4) (1) (3) (2)
(c) (1) (3) (2) (4)
(d) (4) (3) (1) (2)
(xx) Assertion(A): In Java, a method can have the same name as the class.
Reason(R): If a method shares its name with the class, it is treated as a constructor and not a
regular method.
(a) Both Assertion (A) and Reason (R) are true and Reason (R) is a correct explanation of
Assertion (A)
(b) Both Assertion (A) and Reason (R) are true and Reason (R) is not a correct explanation of
Assertion (A)
(c) Assertion (A) is true and Reason (R) is false
(d) Assertion (A) is false and Reason (R) is true
Question 2
(i) Cyber police wanted to investigate a case; they wanted to check a list of phone [2]
numbers that had 945 anywhere in the phone number. Example: 7394567938,
7685483945.., a method was created to convert the phone number in long data
type to a string and check for the existence of the number 945. Fill in the blanks
(a) and (b) in the given method with appropriate Java statements:
void check(long pno)
{ String s = _______(a)_________;
if(______(b)_______)
System. out.println(pno);
}
(ii) What is the value of x after evaluating the following expression? [2]
int x=0,y=0,z=0;
x=(++x +y--)*z++;
(iii) Biswajit wants to display only the alphabets stored in a character array. While compiling the
code, an error was displayed. Check for the statement with the error and write the correct
statement.
char arr[]={‘4’, ‘&’, ‘a’, ‘w’, ‘d’};
int i;
for(i=0;i<arr.length;i++)
Page 4 of 8
{
if(Character. isLetter(arr))
System.out. println(arr);
}
(iv) A Student executes the given program segment and it results in 1.0, irrespective of the [2]
value of n. State the type of the error, write the correct statement:
void solve(int n)
{ double power=Math. pow(n, ⅔);
System. out. println(power);
}
(v) Analyse the given program segment and answer the following questions: [2]
for(i = 3; i <=4; i++) {
for(j=2; j<i; j++) {
System.out.print("*"); }
System. out.println("Simply");}
a. How many times in total will the inner loop execute?
b. Write the output of the program segment.
(vi) Write the output of the following string methods: [2]
String x=“Genes”;
String y=“Engineering”;
a. String z = (x.substring(0,4) + “tic”.concat(y)).toUpperCase( );
b. System.out.println(z.compareToIgnoreCase(y));
(vii) Predict the output of the following code snippet: [2]
char b=‘5’;
int n=(int)b + 13;
System.out.println((char)n + “,” + n);
(viii) Give the output of the following program segment: [2]
for(r=1;r<=3;r++)
{
for(c=1;c<r;c++)
{
System.out. println(r);
}
}
(ix) Consider the following program segment and answer the questions below: [2]
class Shape
{
void area(int l,int b) {
int r=l*b;
System.out.println(r);}
Page 5 of 8
int area(int s) {
return s*s; }
public static void main(String args[ ])
{
Shape ob = new Shape();
ob.area(12,45);
System.out.println((ob.area(40))); }}
a. Name the local variable used in the above program.
b. Name the oop’s principle depicted in the above program.
(x) Consider the array: [2]
int a[ ]={12,35,40,22,56,9,70};
a. In the above given array, using linear search, how many iterations are required to check for
the existence of the value 56?
b. If the array is arranged in descending order, how many iterations are required to check for the
existence of 56 using linear search?
SECTION B
(Attempt any four questions from this Section.)
The answers in this section should consist of the programs in ethier 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]
International Tours and Travels Company has introduced a new tour packages to the different
countries from India. The package and the tariff with discount is as given below
Discount on the
Country Package Amount
Package amount
China 90000 per person 15%
Singapore 25000 per person 12%
Korea 80000 per person 20%
Japan 75000 per person 18%
Design a Class TourPromo using the descriptions given below:
Class name: TourPromo
Instance Variables/Data members
String Cname: to store the country name
Nop: to store the number of persons travelling
Amt: to store the total package amount for the persons travelling
Famt: to store the final amount after the discount
Member Functions/Methods:
TourPromo( ) : default constructor
void getdetails( ): to accept the country name and number of persons travelling
Page 6 of 8
void calcAmt( ): to calculate the total package amount and also the final amount based on the above
given criteria
void printvalue(): displays the country name, number of persons travelling , total package amount and
the amount to be paid after discount.
Write a main method, create object, call the above functions
Question 4 [15]
Tiyasha designs a program to check the strength of a password. A strong password should satisfy the
following conditions:
→length of the password should be atleast 12 characters
→should atleast have 4 upper case letters, 4 lower case letters, 2 digits, 2 special characters
Define a class accept the password and check whether the password is strong or not.
Question 5 [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:
12 10 15 17
30 11 32 71
17 14 29 31
41 33 40 51
Sample Output:
Sum of all even numbers: ..........
Product of all odd numbers: ..........
Question 6 [15]
Define a class to overload the method that performs as follows :
void perform(int x[]) - to display the largest element of the array.
Example: {4, 5, 16, 6, 12, 9}
Largest: 16
void perform (String s, char ch)
If ch is ‘F’ print the first 5 characters, if ch is ‘L’ print the last 5characters
Example: s= “CARPENTER”
ch = F
Output: CARPE
ch = L
Output: ENTER
void perform(int n) : to print the Product of the first and last digits of the number
Page 7 of 8
Example: if n = 45326
Output: 4x6=24
Question 7 [15]
Write a program in Java to accept a String from the user. Pass the String to a method First(String
str) which displays the first character of each word.
Sample Input : Understanding Computer Applications
Sample Output:
U
C
A
Question 8 [15]
a. Define a class to print the Floyds triangle of given rows using nested loops only.
Example:
A Floyd triangle of 6 rows is
1
23
456
7 8 9 10
11 12 13 14 15
16 17 18 19 20 21
b. Define a class to print the sum of the following series:
1+(1+2)+(1+2+3)+..........(1+2+3……20)
Page 8 of 8