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

Moye Moye

i) The document is a preliminary examination paper for grade 10 computer applications students. It contains 20 multiple choice questions in Section A and instructions to attempt 4 questions from Section B. ii) Section A contains questions related to object-oriented programming concepts like classes, objects, inheritance, polymorphism etc. and basic Java programming concepts like data types, operators, loops, arrays etc. iii) Section B instructs students to write Java programs to demonstrate their programming skills and each program should include variable descriptions to clearly show the program logic.
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)
56 views

Moye Moye

i) The document is a preliminary examination paper for grade 10 computer applications students. It contains 20 multiple choice questions in Section A and instructions to attempt 4 questions from Section B. ii) Section A contains questions related to object-oriented programming concepts like classes, objects, inheritance, polymorphism etc. and basic Java programming concepts like data types, operators, loops, arrays etc. iii) Section B instructs students to write Java programs to demonstrate their programming skills and each program should include variable descriptions to clearly show the program logic.
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/ 7

THE FRANK ANTHONY PUBLIC SCHOOL, BANGALORE

PRELIMINARY EXAMINATION
COMPUTER APPLICATION
Grade: 10 Time: 2 hours
Date: 12-01-2024 Max. Marks:100

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
(Attempt all questions from this Section.)
Question 1
i) Name the feature depicted in the picture given below: (1)
a) Encapsulation
b) Class and Object
c) Abstraction
d) Polymorphism

ii) Name the type of expression in the following:


a= 5 / 7.0*(double)b;

1
Computer Application 10
a) Pure Expression
b) Real Expression
c) Unreal Expression
d) Impure Expression

iii) The operator ?: is a: (1)


a) Relational Operator
b) Conditional operator
c) Shorthand operator
d) Assignment operator
iv) When primitive datatype is converted to corresponding object of a
class, it is called: (1)
a) boxing
b) unboxing
c) explicit conversion
d) implicit conversion

v) Assertion (A): The methods in the library class Math- max(), min()
and abs() has multiple definition of the same method with different
datatypes int, long, float and double.
Reason (R): In these methods the concept of method overloading is
used.
a) Assertion (A) and the Reason(R) are false
b) Assertion (A) and the Reason(R) are true
c) Assertion (A) is true and the Reason(R) is false
d) Assertion (A) is false and the Reason (R) is true
(vi) Read the following text and choose the correct answer: (1)
Sorting is the process of arranging the elements of an array so that they can be
placed either in ascending or descending order. There are different types of
sorting techniques.
In selection sort technique, the smallest value among the unsorted elements of
the array is selected in every pass and swapped with the value in appropriate
position. In the Bubble Sort technique the values are compared with the
adjacent elements and swaps them if they are not in the correct order.
Name the sorting technique which has more than on swap per pass.
a) Selection sort
b) Bubble sort
c) Merge sort
d) Both a and b
(vii) Among the following which is not a keyword: (1)
a) int
b) void
c) New
d) System

2
Computer Application 10
(viii) How many bits will the following declaration boolean a[] = new boolean[10]
: occupy: (1)
a) 10
b) 400
c) 80
d) 100
(ix) Which of the following is incorrect when primitive datatypes are passed as
parameters: (1)
a) The changes are not affected
b) The values are copied from the actual parameter to the formal
parameter
c) The changes are affected
d) Actual parameter and the formal parameters are different memory
location
(x) Which of the following is optional in switch- case statement: (1)
a) break
b) case
c) continue
d) switch
(xi) The searching technique which works on a sorted and unsorted array: (1)
a) Linear Search
b) Binary Search
c) Exponential search
d) Jump search
(xii) Assertion (A): Java provides four integer datatypes – byte, short, int, and long..
The memory allocation for each differs. So, depending on the range of value being
store that datatype can be used.
Reason (R): A variable of type int can hold a 12 digit integer. (1)
a) Assertion (A) and the Reason(R) are false
b) Assertion (A) and the Reason(R) are true
c) Assertion (A) is true and the Reason(R) is false
d) Assertion (A) is false and the Reason (R) is true

(xiii) The package in which contains all the wrapper classes:


a) java.util
b) java.lang
c) java.io
d) java.applets
(xiv) The code obtained after compilation of the java program is: (1)
a) Machine code
b) Native executable code
c) Byte code
d) Source code
(xv) The output of the statement: (1)
System.out.println(Math.rint(8.5)+Math.rint(9.2)+Math.rint(9.7));

3
Computer Application 10
a) 27.0
b) 28.0
c) 29.0
d) 26.0
(xvi) The output of the following statement: (1)

System.out.println("Amazon".substring(0,4).concat("Hacking".substring(4)));
a) Amazoing
b) Amazoking
c) Amazing
d) Amazking
(xvii) Give the output of the following code: (1)

int a[][] = {{3,4,5,6},{6,7,8,4}};


System.out.println(a[1][2]+""+a[0][3]);
a) 75
b) 86
c) 45
d) 64
(xviii) What is the datatype and the value of a when the following statement is
executed: a = Integer.parseInt("1234" ); (1)
a) int 1234
b) String 1234
c) String “1234”
d) Integer 1234
(xix) Which of the following methods will result in 352.0 when the value passed
to is 352.7? (1)
a) ceil()
b) floor()
c) round()
d) random()
(xx) A 4-bit primitive datatype which store number without decimal point: (1)

a) int
b) long
c) short
d) byte
Question 2
i) How many times is the loop executed and what is the output? (2)
{ int p=0,q=1;
while(p++ <= 10)
q += p++;
System.out.println(q);
}
ii) Write a function prototype in which the method Fun takes a long
value and a character value as argument and returns nothing. Also.
Write the function call statement for the above prototype. (2)
iii) The following code prints the sum of the arguments of a and b in the method
Display(). There is an error in the code. Identify, the type of error(Syntax,

4
Computer Application 10
Logical or Run-time). Also, re-write the method Display() with the correct
statement.

{ int Calculate(int a, int b)


{ int sum;
sum = a+b;
return sum;
}
void Display()
{ System.out.println("the sum is "+sum);
}
}

iv)Convert the following for loop to do-while loop: (2)


{ int a=0,b=1;
for(int i=1; i<=3 ; i+=2)
a+=b++;
System.out.println(a)
}
v)Go through the following code and answer the question related to the it. (2)
int a[] = {7,6,3,8}; int b[] ={4,7,2};
i) All the even numbers of the array a[] and b[] are copied to another
array c[]. Write a statement to print the dimension of the array c[].
ii) Write a statement to print the last element of the array c[].
vi)Write the java statement for the following algebraic statement: (2)

𝟐𝒙𝟓
+ 𝐬𝐢𝐧(𝟒𝟓)
|𝟓𝒙𝟕 |

vii)Give the return type of the following methods: [2]


i) Integer.parseInt();
ii) Double.valueOf();
viii)Do as directed for the following statements. [2]
i)Write a statement to create a constant variable AR with the value 45.3
ii) To check if the character ch is a number or an alphabet.
xix) Rakesh wants to create a variable ab which belongs to the class rather
than the objects of the class. Which type of variable is being referred to? Write
a statement to create variable ab of that type.
xx)Identify, Autoboxing and Unboxing concept in the following code: [2]
a)Float F = new Float(3.24f); b)Boolean f = false;
float a = F.Value(); Boolean B = new Boolean(f)

5
Computer Application 10
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 [15]
Write a menu driven program using switch-case to print the following depending
on the user’s choice:
+A+B+C
A +D+E+
BC +F+G
DEF +H+
GHIJ +I
KLMNO +

Question 4 [15]
Create a Double dimension array 5x5 to input 25 integers and perform the
following operations:
a) Print the non-diagonal elements
b) Find the sum of each row
Question 5 [15]
Write a program to accept N alphabets in a single dimension array. Arrange
them in alphabets order using Selection sort. Print only the vowels present in
the sorted array.
Question 6 [15]
Design a class to overload the following method to perform the following
operations:
void Print(int num): With one integer argument checks and print if the number
is a Balanced Number or not.
A number is a Balanced number if the sum of digits is equal to the count of
digits. Eg: num = 11 Sum = 2 count = 2
Num = 20 sum = 2 and count =2
void Print(String S1, String S2): convert both the Strings to uppercase. To
check and print if both the Strings are Balanced. A String is said to be Balanced
if both the String has the same count of vowels and consonants,
eg. String 1 = ANT String S2 = CAN
It is Balanced as both have same count of vowels(1) and same count of
consonant(2).

6
Computer Application 10
Question 7 [15]
Define a class to accept 10 strings in an array and convert all of them to
lowercase. Print the string which begins with a vowel.
Question 8 [15]
The travel agency Robin Hook provides Domestic and International packages.
Based on the package amount and the days travelled discount is calculated.
Additional discount is calculated for early booking. Write a program to calculate
discount amount.
Class Name:- Robin Hook
Member variables:-
String name – Name of the traveler
double p_amt – store the package amount
char cat – stores the category E-Early bird booking L-Late booking
int days – To store the number of days of the package

Member methods:-
(i)void accept () – accept name of the traveler, package amount, days and the
category
(ii) double Com_Disount() – calculate discount amount based on conditions:
Package Amount Days Discount
Amount
<=50,000 <=5 10%
>50,000 and >5 and <=10 15%
<=1,00,000
>1,00,000 >10 25%
If the category = E then an additional discount of 20% is given on the
Package amount

(iii) void Display () – To calculate the final amount and displays all the details
in the following format:
Passengers Name ------
Package amount ----------- Discount Amount ------
Final Amount ------
void main() – to create an object and call the above member methods.

**********************************************************************************

7
Computer Application 10

You might also like