0% found this document useful (0 votes)
16 views10 pages

Selection Question 2024

This document is a preboard examination paper for Class X Computer Applications, consisting of two sections with a total of 100 marks. Section A contains multiple-choice questions and Section B requires programming tasks, with specific instructions on answering and time management. The exam covers various topics in Java programming, including concepts like inheritance, constructors, and string manipulation.

Uploaded by

revheadz82
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)
16 views10 pages

Selection Question 2024

This document is a preboard examination paper for Class X Computer Applications, consisting of two sections with a total of 100 marks. Section A contains multiple-choice questions and Section B requires programming tasks, with specific instructions on answering and time management. The exam covers various topics in Java programming, including concepts like inheritance, constructors, and string manipulation.

Uploaded by

revheadz82
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/ 10

Modern English Academy

Computer Applications
Maximum marks:100
Time 2 hrs
Preboard Examination 2024
Class X

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
from Section B.
The intended marks for questions or parts of
questions are given in brackets [].

Question 1
[1*20=20]
i)Wrapper classes are available in __________ package.
a)java.io b)java.util c)java.lang d)java.awt

ii)Inheritance is the basic principle on which we can create new classes from
existing classes by inheriting some of the properties.It is based on the concept of

1
a)data hiding b)reusability c)function overloading d)modularity

iii)The size of '\t' is


a)2 bytes b)4 bytes c)8 bytes d)16 bytes

iv)A default constructor takes ________ parameters.


a)many b)two c)one d) zero

v)The return type of the toLowerCase() function is


a)char b)boolean c)int d)double

vi)Which variable is the accumulator variable in the statement:sum=sum+(i+x);


a)i b)x c)sum d)i and x

vii)Find the output of the following code


Math.pow(Math.ceil(Math.abs(-3.4)),Math.floor(3.8));
a) 81.0 b)64.0 c)27.0 d)8.0

viii)Which operator invokes members of a class?


a)new b)dot c)object d)all

ix)Which of the following is not a jump statement?


a)return b)continue c)switch-case d)break.

x)What is the return type of the function compareTo()?

a)boolean b)int c)char d)String

xi)A method that converts a string to a primitive integer datatype?

2
a)Integer.toString() b)Long.parseLong() c)Integer.parseInt() d)Float.toString()

xii)Which of the following is representing the constructor of ABC class


a)abc b)ABC c)ABC() d)ABC_constructor

xiii)Which of the following declaration and initialization in the line given below
is equivalent to
String str=new String();
a)String str= “ ”; b)String str= “0”;c)String str=null;d)String str= “\0”;

xiv)Name the type of error


double x,y,z;
x+y=z;
a)logical b)syntax c)runtime d)no error

xv)The method to check whether a character is a letter or a digit.


a)isDigitorLetter(char) b)isLetterOrDigit(char) c)isLetterOrDigit()
d)isLetterORDigit(char)

xvi)Assertion(A):Protected variables and methods can be accessed in the class


in which they are declared and in the child class.
Reason(R) :Private variable and methods can only be accessed in the class in
which they are declared.
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 is false and Reason (R) is true.

xvii)The default value of boolean variable is

3
a)false b)0 c)False d)true

xviii)Assertion(A):The base class and derived class are the terms used in
abstraction.
Reason(R ):The concept of extending a class to obtain another class is called
inheritance.
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 is false and Reason (R) is true.

xix)Give the output and mention how many time the loop will be executed ?
int a,b;
for(a=6,b=4;a<=24;a=a+b)
{
if(a%b==0)
break;
}
System.out.println(a);
a)12,2 b)12,3 c)10,1 d)10,2
xx)Robin wants the members of his class Employee to be accessible only to his
class “Employee”,what access specifier he should use for the members?
a)Public b)Private c)Protected d)default

Question 2
[2*10=20]
i)Rewrite the following using if else statement:
int m=400;

4
double ch=(m>300)?(m/10.0)*2 : (m/20.0)-2;

ii)Evaluate the expression when the value of x=4;


x*=--x+ x++ + ++x;

iii)Identify the errors giving reason and correct the Java statements.

double product(int p,q)


{
r=p*q;
s=r*q;
return r,s;
}

iv)
Write the Java expression.
| |

v)
How many times the following loop will execute? Write the output of the code:
char m[]={‘C’, ‘O’, ‘M’, ‘P’, ‘U’, ‘T’, ‘E’, ‘R’};
for (int i=0, j=7;i<4;i++,j--)
{
System.out.println(m[i]+m[j]);
}

vi)
Write the out put of the following String methods:
String a[]={“PHYSICS”, “ENGLISH”, “MATHEMATICS”, “CHEMISTRY”,
“BIOLOGY”};
5
Give the output:
a)System.out.println(a[0].length()==a[4].length());
b)System.out.println(a[1].compareTo(a[3]));

vii)
Predict the output of the following code snippet:
String a[]={“325”, “135”, “345”, “555”};
for(int i=0;i<4;i++)
{int x =Integer.valueOf(a[i]);
if(x%3!=0&&x%5==0)
System.out.println(x);
}

viii)
The following code to compare two strings is compiled,the following syntax
error was displayed “incompatible types-int cannot be converted to
boolean”,Identify the statement which has the error and write the correct
statement.Give the output of the program segment after correcting.
void calculate()
{
String a= “KING”,b= “KINGDOM”;
boolean x=a.compareTo(b);
System.out.println(x);
}

ix)
Create the default and parameterised constructor for the given class definition.
class abc
{

6
double d;
char c;
boolean b;
}

x)
State the output:
int x[]={1,2,3,4,5,6,7,8};
System.out.println(x[3]*2);
System.out.println(x[5]+4);
System.out.println(x[6+1]*2);

Section -B(60 MARKS)


(Answer any four questions from this section)
Each program should be written using variable description/mnemonic
code so that the logic of the program is clearly depicted.
Flowcharts and algorithms are not required.

Question 3
[15]
Design a class CONVERT that is described as follows:
datamember:
float centigrade;
default constructor:To initialize centigrade to its default value.
parameterised constructor:To assign the temperature in centrigrade scale to its
data member.

7
method:
CentiToFaren():To compute the farenheit equivalent of the centigrade
temperature and return its result.
main() :to compute farenheit equivalents of centrigrade temperatures from 10 °C
to 100°C in steps of 5°C.
Question 4
[15]
Write a program to initialize two arrays with name of country and its currency
given below.Sort array B in ascending order using bubble sort and sort A
accordingly.
Input:
A[]:The list of countries B[]:The list of currencies
Afghanistan Afghani
Albania Lek
Algeria Dinar
Andorra Euro
Angola New Kwanza
Antigua and Barbuda East Caribbean dollar
Argentina Peso
Australia Australian dollar
Output:
A: array with respect to sorted array B
Afghanistan Afghani

Australia Australian dollar

Algeria Dinar

Antigua and Barbuda East Caribbean dollar

Andorra Euro

Albania Lek

8
Angola New Kwanza

Argentina Peso

Question 5
[15]
Special words are the words which starts and ends with the same letter.
Examples
Existence
Comic
window
Palindrome words are those words which read the same from left to right and
vice-versa.Examples:-MALAYALAM
MADAM
LEVEL
ROTATOR
CIVIC
All palindrome words are special words but all special words are not
pallindrome.Write a program to accept a word ,check and print whether the
word is a palindrome or only special word.

Question 6
[15]
Write a program to accept the year of birth of students as integer value from the
user. Using binary search technique on the sorted array of integers given below,
output the message "Record exists" if the value of the input is located in the
array.If not output the message "Record does not exist"
The given array is {1982,1985,1988,1999,2001,2005,2015}

Question 7
9
[15]
Print the following patterns using a menu driven class.
i) ESCIICSE ii) *
ESCCSE ***
ESSE *****
EE *******
*********

Question 8
[15]
Define a class to declare a character array of size ten, accept the characters into
the array, sort the array using selection sort and display the sorted array, the
character with highest and lowest ASCII value.
Example:
Input : ‘r’, ‘z’, ‘P’ , ‘a’ , ‘n’, ‘p’, ‘m’, ‘U’, ‘Q’, ‘F’.
Output:FPQUamnprz.
Highest: z
Lowest: F

******************xxxxxxxxxxxxxxxxxxxxxxxxxxxxx***********

10

You might also like