Code is copied!
CLASS 10 ICSE JAVA COMPUTER APPLICATIONS BOARD PAPER 2023 - 8
Maximum Marks:100
Time allowed: Two 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 is divided into two Sections.
Attempt all questions from Section A and any four questions from Section B.
Answers to this Paper must be written on the paper provided separately.
The intended marks for questions or parts of questions are given in brackets[] .
SECTION A
(Attempt all questions from this Section.)
Question 1
(i)
Wrapping up of data and methods together as one unit is termed as:
- Inheritance
- Polymorphism
- Encapsulation
- Abstraction
(ii)
The datatype which is specified that the method does not return a value is:
- Void
- void
- VOID
- boolean
(vi)
The correct if statement for the following ternary operation statement is:
System.out.println(n%2 == 0? “true”:” false”);
-
if(n%2==0)
return true;
else
return false;
-
if(n%2==0)
return “true”;
else
return “false”;
-
if(n%2==0)
System.out.printIn(“true”);
else
System.out.println(“false”);
-
if(n%2==0)
return false;
else
return false;
return true;
else return false;
return “true”;
else
return “false”;
System.out.printIn(“true”);
else
System.out.println(“false”);
return false;
else
return false;
(viii)
The number of bytes occupied by the constant 45 are:
- Four bytes
- two bytes
- Eight bytes
- one byte
(ix)
do.....while loop is an
- entry controlled loop
- infinite loop
- exit controlled loop
- Finite loop
(x)
for(k=1;k<=2;k++)
{ for(m=1;m<=4;m++)
{ System.out.println(m*2);
}
}
How many times the inner loop is executed?
- 4 times
- 8 times
- 2 times
- 16 times
(xi)
A method with the same name as of the class and with arguments and no return
data type is termed as:
- parameterized constructor
- default constructor
- Non -parameterized constructor
- wrapper class method
(xiii)
The style of expressing single line comment is:
- /* comment*/
- * comment
- // comment
- /* comment
(xiv)
The method to check if a character is an alphabet or not is:
- isLetter(char)
- isAlpha(char)
- isUppercase(char)
- isLowercase(char)
(xvi)
The method to convert a string to upper case is:
- toUpperCase(char)
- toUPPERCASE(String)
- toUpperCase(String)
- touppercase(String)
(xvii)
The output of the method “DETERMINATION” substring(2, 6) is:
- “TERM”
- term
- “Term”
- “TERMI”
(xix)
The element in x[4] of the array {3, 5, 7, 12, 16, 18, 20, 35, 42, 89} is:
- 16
- 12
- 7
- 18
(xx)
Name the type of error that occurs for the following statement:
System.out.printIn(Math.sqrt(24 - 25));
- Syntax error
- runtime error
- logical error
- no error
(iv)
Rewrite the following while loop using for loop:
int x = 5;
while (x <= 5)
{
x++;
}
System.out.println(x);
(v)
How many times the following loop will gets executed? What is the output of
the same?
int counter=1;
do
{
System.out.printIn(counter);
} while ( counter ++ < 5 );
(ix)
Consider the following program and answer the questions given below:
class sample
{ int a, b;
sample(int x, int y)
{ a=x,b=y;
}
void calculate()
{ int Z;
Z=atb;
System.out.println(z);
}
}
(a) Name the global variables.
(b) What are the method variables?
(x)
Consider the following array and answer the questions given below:
int x [ ] = {23, 45, 67, 12, 45, 89, 24, 12, 9, 7}
(a) What is the size of the array?
(b) What is the position of 89?
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.
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
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:
void accept() — 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 = 17.45% of basic
pf = 8.10% 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