JAVA MATLAB ramjijava80@gmail.
com
RAMJI SIR MOB.-9305035029
PAGE-1
Guess Paper – 2023
Class – X
Subject – Computer Applications
Section-A
Question 1 [20]
Choose the correct answer and write the correct option.
(i) Which feature of OOPS described the reusability of code?
a. Abstraction b. Encapsulation
c. Polymorphism d. Inheritance
(ii) The number of bytes occupied by the constant ‘A’ are:
a. 4 b. 2 c. 8 d. 1
(iii) Which loop evaluates the condition expression as Boolean, if it is true, it executes the
statements and when it is false it will terminate?
a. For loop b. while loop
c. do-while loop d. All of the above
(iv). A function with parameters of primitive data type is.
a. Called by value b. Calles by reference
c. (a) or (b) d. None of these
(v). Analyze the following program segment and determine how many times the
loop will be executed. What will be the output of the program segment?
int k 1, = 2;
while(++i<6)
k*=i;
System.out.printin(k):
a. 4 times 80 b. 2 times 40
c. 3 times 60 d. 1 time 10
(vi). Which of the following is not an access specifier in Java?
a. Private b. Public
c. Package d. Protected
(vii). What is the output of the following code?
System.out.printIn(Math.pow(49,1/2) + Math.sqrt(81));
a. 0 b. 9.0
c. 10.0 d. 16.0
(viii). An identifier is the name given to
** Declaration: This Guess Paper is my personal opinion for ICSE Board Exam 2022-23. Therefore, it should not be considered completely true and children
should take Board Exam 2023 according to their hard work & sense.
UDISHA COMPUTERS,”THE ULTIMATE HUB OF JAVA PROGRAMMING “
JAVA MATLAB
[email protected] RAMJI SIR MOB.-9305035029
PAGE-2
a. Variable b. Method
c. Class d. All of these
(ix). Write the output of the following program snippt:
char c='A';
int n= (int) c + 32;
System.out.printin((char)n);
a. 'B' b. ‘a'
c. ‘C’ d. None of these
(x). What does the statement System.out.printIn(12/0); result in?
a. Run time error b. Syntax error
c. Infinity NaN d. Logical error
(xi). Write the return data type of the fallowing functions
startsWith() & random()
a. double, boolean b. double, true
c. boolean, double d. boolean, true
(xii) Conditional operator also called….
a. Unary Operator b. Binary Operator
c. Ternary Operator c. Logical Operator
(xiii) "School".substring(2,5) will result-
a. hoo b. ool
c. sch d.schoo
(xiv) The function which changes the state of an object is known as:
a. Pure function b. Impure function
c. Replace method c. None of the above
(xv) Which of the following for loop declaration is not valid?
a. for ( int i = 99; i >= 0; i / 9 ) b. for ( int i = 7; i <= 77; i += 7 )
c. for ( int i = 20; i >= 2; - -i ) d. for ( int i = 2; i <= 20; i = 2* i )
(xvi) Which keyword is used for accessing the features of a package?
a. package b. import
c. extends d. export
** Declaration: This Guess Paper is my personal opinion for ICSE Board Exam 2022-23. Therefore, it should not be considered completely true and children
should take Board Exam 2023 according to their hard work & sense.
UDISHA COMPUTERS,”THE ULTIMATE HUB OF JAVA PROGRAMMING “
JAVA MATLAB
[email protected] RAMJI SIR MOB.-9305035029
PAGE-3
(xvii) What is the output of the below java code?
int bat[] = { };
System.out.print(bat);
a. 0 b. -1
c. Garbage value d. Compiler error
(xviii) Which of the following do not represent legal flow control statements?
a. break; b return;
c. exit(); d. continue;
(xix) Consider the following code and predict the output.
String s = new String("5");
System.out.println(1 + 10 + s + 1 + 1);
a. 1152 b. 11511
c. 1105110 d. 18
(xx) The concept of having more than one constructor with different types of parameters:
a) Copy constructor b Constructor overloading
c) Method overloading d) overloaded methods
Question 2
(i) For initial value of a=4, b= -3, c=0, what will be the value of the x in following expressions: [2]
x = a+ b-- / --c * ++b – c++;
x - = ++b * ++a % --c + a;
(ii) Write a java expression for the following [2]
i. x = b - 4ac ii. y = | ex + log a |
2a
(iii) Rewrite the if …else using ternary operator (?:) then find the value of p. [2]
int m=2, n=4,p;
if((m - 3)==n)
p=(Math.pow(m,2));
else
p=((m*m)-Math.pow(n,2));
(iv) Rewrite the while loop using for loop and Give the output: [2]
int i=65,j=0;
while(j<=10)
{
System.out.print((char)i);
i++;
j=j+3; }
** Declaration: This Guess Paper is my personal opinion for ICSE Board Exam 2022-23. Therefore, it should not be considered completely true and children
should take Board Exam 2023 according to their hard work & sense.
UDISHA COMPUTERS,”THE ULTIMATE HUB OF JAVA PROGRAMMING “
JAVA MATLAB
[email protected] RAMJI SIR MOB.-9305035029
PAGE-4
(v) NAME THE Keywords….
Keyword is used to distinguish between instance variable and class vatiable.
Keyword is used to make a constant declaration of variable.
(vi) How many times the loop will gets executed.? Find the output of the following code: [2]
int x[]={60,50,30,40},y=3,size=4;
for(int i=size-1;i>0;i--)
switch(i)
{
case 0:
case 2: System.out.println(y*x[i-1]); break;
case 1:
case 3: System.out.println(++y+x[i]);
}
(vii) Give the output for the following. [2]
String s="Java Matlab",p=”RAMJI SIR”;
i. System.out.print(s.substring(5).compareTo(p.substring(0,5)));
ii. System.out.print(s+p.substring(0, p.indexOf(‘S’));
iii. System.out.print(Math.abs(Math.rint(-6.25)));
iv. System.out.print(Math.round(Math.min(15.46, -6.25)));
(viii) What is constructor overloading? Difference B/w Parameterize &Default constructor.
(ix) Difference between pass by value and pass by reference.
(x) Write Java statements to the following : [2]
(i) initialize a character Array chr[] with all uppercase vowels.
(ii) replace all occurrence of character ‘E’ with ‘A’ in String str= “JEVE METLEB REMJI SIR”.
(iii) write the prototype of method udisha() that return boolean results and take one integer
and one character arguments as a parameter.
(iv) convert a number n=275 into String object String str;
Section B (60 Marks)
Attempt any four questions from this section
Question 3. [15]
Anshul transport company charges for the parcels of its customers as per the following specifications
given below:
Class name: Atransport
Member variables:
** Declaration: This Guess Paper is my personal opinion for ICSE Board Exam 2022-23. Therefore, it should not be considered completely true and children
should take Board Exam 2023 according to their hard work & sense.
UDISHA COMPUTERS,”THE ULTIMATE HUB OF JAVA PROGRAMMING “
JAVA MATLAB
[email protected] RAMJI SIR MOB.-9305035029
PAGE-5
String name – to store the name of the customer
int w – to store the weight of the parcel in Kg
int charge – to store the charge of the parcel
Member functions:
Atransport() : Constructor initialize default value to the data member of the class.
void accept ( ) : to accept the name of the customer, weight of the parcel from the user (using
Scanner class)
void calculate ( ) : to calculate the charge as per the weight of the parcel as per the following
criteria:
Weight in Kg Charge per Kg
Upto 10 Kgs Rs.25 per Kg
Next 20 Kgs Rs.20 per Kg
Above 30 Kgs Rs.10 per Kg
A surcharge of 5% is charged on the bill.
void print ( ) – to print the name of the customer, weight of the parcel, total bill inclusive of
surcharge in a tabular form in the following format:
Name Weight Bill amount
------- ------- -------------
Define a class with the above-mentioned specifications, create the main method, create an object and
invoke the member methods.
Question 4. [15]
Define a class to declare an array to accept and store ten names(Strings). Sort names in alphabetical
order using bubble sort technique Display sorted array.
Sample Input: Rohit, Devesh, Indrani, Shivangi, Himanshu, Rishi, Piyush, Deepak, Abhishek,
Kunal, …..
Sample Output: Abhishek, Deepak, Devesh, Himanshu, Indrani, Kunal, Piyush, Rishi, Rohit,
Shivangi, …..
Question 5. [15]
Overload a function print() to perform the following tasks .
void print(int a) – To check whether the input number is a neon number.
(A neon number is such a number whose sum of digits of
square of the number is equal to the number).
Eg: 92 = 81 i.e. 8 + 1 = 9
** Declaration: This Guess Paper is my personal opinion for ICSE Board Exam 2022-23. Therefore, it should not be considered completely true and children
should take Board Exam 2023 according to their hard work & sense.
UDISHA COMPUTERS,”THE ULTIMATE HUB OF JAVA PROGRAMMING “
JAVA MATLAB
[email protected] RAMJI SIR MOB.-9305035029
PAGE-6
void print(int x, int n) – To print sum of the fallowing sum of series.
X – X3 + X5 – X7 ………………………….N TERM
void print () – To print the following pattern.
1
10
101
1010
10101
Question 6:
Write a program in Java to store 20 numbers in a Single Dimensional Array (SDA). Display the
numbers which are prime.
Sample Input:
n[0] n[1] n[2] n[3] n[4] n[5] … n[16] n[17] n[18] n[19]
45 65 77 71 90 67 … 82 19 31 52
Sample Output: 71, 67, 19, 31
Question 7: [15]
Write a program in Java to accept a string. Arrange all the letters of the string in an alphabetical
order.
Sample Input: Alphabetical order:
computer cemoprtu
Question 8: [15]
Write a program in Java to input the names of 10 cities in a Single Dimensional Array. Display only
those names which begin with a consonant but end with a vowel.
Sample Input: Kolkata, Delhi, Bengaluru, Jamshedpur, Bokaro, …….
Sample Output: Kolkata, Delhi, Bengaluru, Bokaro, ….…. [15]
** Declaration: This Guess Paper is my personal opinion for ICSE Board Exam 2022-23. Therefore, it should not be considered completely true and children
should take Board Exam 2023 according to their hard work & sense.
UDISHA COMPUTERS,”THE ULTIMATE HUB OF JAVA PROGRAMMING “