Kisa Preparatory Paper Computer Applications

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

KARNATAKA ICSE SCHOOLS ASSOCIATION

ICSE STD-X
Preparatory Examination 2023
Subject: Computer Applications
Date: 09-02-2023 Duration: 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.
The intended marks for questions or parts of questions are given in brackets[ ].
______________________________________________________________________________________
SECTION A
(Attempt all questions from this Section)
Question 1

Choose the correct answer and write the correct option.


i) When Wrapper class object converted to its corresponding primitive data type, it is called as_________.
(a) Boxing
(b) Unboxing
(c) Implicit type conversion
(d) Explicit type conversion
ii) Which of the following is called as array declaration?
(a) int a[ ];
(b) float [ ]b;
(c) int x[10];
(d) Both (a) & (b)
iii) The translators used in java are ____________ and ___________.
(a) Assembler and Interpreter
(b) Compiler and Assembler
(c) Compiler and Interpreter
(d) None of the above
iv) The result of (5672%100)/10 is __________.
(a) 6
(b) 2
(c) 5
(d) 7
v) int a=5, b=7; the result of !(a<=b) is _________________.
(a) true
(b) false
(c) True
(d) False
vi) char a='A';
int b=4;
char c=a+b;
System.out.println(c);

1
(a) Syntax error
(b) E
(c) e
(d) 69

vii) Which of the following represents a multi line comment?


(a) \*........................*/
(b) //*.......................*//
(c) /*...............................*/
(d) */...........................*/
viii) The Scanner class method(function) that reads a floating point token upto 32-bitscapacity is ______.
(a) next Float( )
(b) nextFloat( )
(c) NextFloat( )
(d) nextfloat( )
ix) if(x%2==0)
{
if(x<=20)
{
System.out.println(x);
}
}
Which of the following is correct, when the above code has to be written using single ifstatement?
(a) if(x%2==0 || x<=20) System.out.println(x);
(b) if(x%2==0 && x<=20) System.out.println(x);
(c) if(x%2==0 & & x<20) System.out.println(x);
(d) All of the above
x) Decision Control Statement in java can be implemented using _____________.
(a) if
(b) if else
(c) Conditional (Ternary) Operator
(d) All of the above
xi) String x="12", y="10"; int a=Integer.parseInt(x);
System.out.println(a+y);
(a) 22
(b) 1210
(c) 1012
(d) Syntax Error
xii) int x[ ] = new int[10];
System.out.println (x[3]);
(a) Syntax Error
(b) Runtime Error
(c) 0
(d) -1
xiii) int x[ ]={2, 4, 6, 8, 10, 12};
System.out.println (x[2]++ + ++x[4] + x[2]);
(a) 24
(b) 23
(c) 25
(d) 22

2
xiv) Which of the following statement displays the 2nd element of an array x?
(a) System.out.println(x[2]);
(b) System.out.println(x[1]);
(c) System.out.println(x[3]);
(d) None of the above
xv) Name the type of error in the statement:
int x[ ]={1, 2, 3};
System.out.println(x[x.length]);
(a) Syntax error
(b) Run time error
(c) Logical error
(d) No error
xvi) The array float a[ ]=new float[5] occupies:
(a) 10 bytes
(b) 40 bytes
(c) 20 bytes
(d) 80 bytes
xvii) String s1="BASIC", s2="BASE";
System.out.println (s1.length ()+ s2.length());
(a) 10
(b) 9
(c) 8
(d) 11
xviii) The output of the method “Technology”.substring(4,10) is:
(a) Syntax error
(b) nology
(c) logy
(d) Runtime error
xix) A method with the same name as of the class and with arguments and no return datatype is termed as:
(a) parameterized constructor
(b) default constructor
(c) Non-parameterized constructor
(d) Wrapper class method
xx) String a="35", b="8"; int x=Integer.parseInt(a);
double y=Double.parseDouble(b);
System.out.println(x+y);
(a) 43
(b) 358
(c) 43.0
(d) 835

Question 2

i) Evaluate the expression:


int x=10,y=5;
float z=y/x + ++x + ++y;
System.out.println(z);

ii) Write java expression for:


a4+b2

3
iii) Rewrite the following using ternary operators:
if(sale>15000)
comm=sale*5.0/100;
else
comm=0;

iv) Rewrite the following while loop using for loop:


int x=0;
while(x<10)
{
System.out.println(x);
x++;
}

v) How many times the following loop will gets executed? What is the output of the same?
for (inti=20; i>=2;i-=2)
{
if(i%4==0)
continue;
System.out.println(i);
}

vi) int a=410,b=510;


System.out.println(String.valueOf(a) + String.valueOf(b));

vii) String a=“Floppy”,b=“Disk”;


System.out.println(a.charAt(0) +“ ”+ b.charAt(0));

viii) Define Abstraction.

ix) Consider the following program and answer the questions given below:
class record
{
static int m,n;
int z;
public static void show( )
{
m=25;
n=36;
}
public void display()
{ int h=27;
record sum=new record( );
}
}
(a) Name the class(static) and instance variables.
(b) Can the variable h be used in other functions? Give reason.

x) Consider the following array and answer the questions given below:
int x[ ]={2,4,6,8,10,12,14,16,18,20};
(a) What is the size of the array?
(b) What is the index position of 14

4
SECTION B
(Answer any four questions from this Section.)
The answers in this section should consist of the program 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:

Design a class Hotel with the following description:


Member variables:
String name – to store the name of the customer
long mno – to store the mobile number of the customer
double bill – to store the bill amount
double gst – to store the GST amount
double st – to store the service tax
double tamt – to store the total amount to be paid by the customer
Member methods:
void accept() – to accept customer’s name, mobile number, GST, service tax and amount.
void calculate() – to calculate GST, service tax and total amount to be paid by the customer.
gst = 18% on bill
st = 12.5% on bill
tamt = bill +gst +st
void display() – to display the customer’s name, mobile number and bill amount.
Write a main method to create an object and invoke the above member methods.

Question 4:

Define a class to accept 20 students marks in a subject out of 100 in a single dimensional array and display the
number of students who have secured marks:
i) 90 and above ii) 40 and less than 40

Question 5:

Define a class to accept two string and convert both the strings to lowercase and display only the common
characters at the corresponding index position of both the strings only if both the string has same length.
Sample Input: s1=”heroic”
s2=”health”
Sample Output: h,e

Sample Input:
s1=”Device”
s2=”Demands”
Sample Output:
Strings length do not match

Question 6:

Define a class to input 10 words and arrange the words in descending order using bubble sort technique.
Display the sorted array.

5
Question 7:

Design a class to overload the method display() as follows:


a) void display() – Print the given Pattern using nested loop.
2
4 4
6 6 6
8 8 8 8
10 10 10 10 10
b) void display(int n) – Print the first ‘n’ terms of the series 1,-3,5,-7……………n terms
c) void display(int x,int y) – Display the last digit of x and y; if x and y are greater than or equal to 10
Example: If x is 45 and y is 12
Output : Last digit : 5 and 2

Question 8:

Define a class to accept the years of graduation from a school as integer values from the user. Using Binary
Search technique on the sorted array of integers given below, output the message “Record exists” if the value
input is located in the array. If not, output the message “Record does not exist”.
[1982,1987,1993,1996,1999,2003,2006,2007,2009,2010]

You might also like