COMPUTER APPLICATIONS
Maximum Marks: 100
Time allowed: Two hours
Answers to this Paper must be written on the paper provided separately.
You willnot 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.
ThisPaper is divided into twoSections.
Atempt all questions from Section Aand any four questions from Section B.
The intended marks for questions or parts of questionsare given inbrackets[ ].
SECTION A (40 Marks)
(Attempt all questions fromthis Section.)
Question 1 [20]
Choose the correct answers to the questions from the given options.
(Donot copy the questions, writethe correct answers only.)
(i)
Polygon
Consider the above picture and choose the correct statement fromn the following:
(a) Polygon is the object and the pictures are classes
(b) Both polygon and the pictures are classes
(c) Polygon is the class and the pictures are objects
(d) Both polygon and the pictures are objects
This paper consists of 11printed pages and 1 blank page.
T24 861 Turn Over
OCopyright reserved.
(ii) int x =98; char ch = (char)x: what is the value in ch?
(a) b
(b) A
(c) B
(d) 97
(iii) The output of the statement "CONCENTRATION".index0f("T') is:
(a)
(b) 7
(c) 6
(d) (-1)
(iv) The access specifier that gives least accessibility is:
(a) package
(b) public
(C) protected
(d) private
(v) The output of the statement "talent".compareTo("'genius") is:
(a) 11
(b) -11
(c) 0
(d) 13
(vi) Which of the following is an escape sequence character in Java?
(a) /n
(b) \t
(c) /t
(d) //n
T24 861 2
(vii) if
(a>b&&b>c) then largest number is:
(a) b
(b) c
(c) a
(d) Wrong expression
(vi) What is the output of [Link](5.4)
+[Link](4.5)?
(a) 10.0
(b) 11.0
(c) 12.0
(d) 9.0
(ix) What is the method to check whether a character is a letter or digit?
(a) isDigit(char)
(b) isLetterOrDigit()
(c) isLetterOrDigit(char)
(d) isLETTERorDIGIT(char)
(x) The extension of a Java source code file is:
(a) exe
(b) obj
(c) jvm
(d) java
(xi) The number of bytes occupied by a character array of four rows and three
columns are:
(a) 12
(b) 24
(c) 96
(d) 48
T24 861 Turn Over
construct?
(xii) Which of the following data tvpe cannot be used with switch case
(a) int
(b) char
(c) String
(d) double
(xiii) Which of the following are entry controlled loops?
1. for
2. while
3. do..while
4. switch
(a) only 1
(b) 1and 2
(c) and 3
(d) and 4
(xiv) Method which reverses a given number is:
(a) Impure method
(b) Pure method
(c) Constructor
(d) Destructor
(xv) If the name of the class is *Yellow", what can be the possible name for its
constructors?
(a) yellow
(b) YELLOW
(c) Yell
(d) Yellow
4
T24 861
(xvi)
hvokng amethod by nassine the obiects of a class is termed as.
(a) Call by
refercnce
(b) Call by value
(c) Call by method
(d) Call by
constructor
(xvii) The correct statement to create an object named mango of class fruit:
(a) Fruit Mango= new fruit();
(b) fruit mango = new fruit()0;
(c) Mango fruit=new Mango);
(d) fruit mango= new mango);
(xvii) Assertion (A): Static method can access static and instance variables.
Reason (R): Static variable can be accessed only by static method.
(a) Assertion and Reason both are correct.
(b) Assertion is true and Reason is false.
(c) Assertion is false and Reason is true.
(d) Assertion and Reason both are false.
(xix) What is the output of the Java code given below?
String color [] = "Blue", "Red", "Violet"}:
[Link].print1n(color(2|.length)0):
(a) 6
(b) 5
(c) 3
(d) 2
T24 861 Turn Over
(xx)
Which of the following mathematical methods returns only an integer?
(a) [Link](n)
(b) [Link](n)
(c) [Link](n)
(d) [Link](n)
Question 2
() Write Java expression for: (2]
Ja + b|
Va' + b2
(ii) Evaluate the expression whenx is 4: [2]
xt=rt+* t+x %2:
(ii) Rewrite the following do while program segment using for: [2]
X=10; y=20;
do
x++;
y++;
}while (x<-20);
[Link](x *y);
(iv) Give the output of the following program segment. How many times is the loop [2]
exccuted?
for(x=10; x>20;x++)
[Link](x);
[Link](x*2);
T24 861 6
(v) String s1= "45.50"; String s2 - "54,50"; [2)
double [Link](s1);
double [Link](s2);
int x= (int)(d1 +d2);
What is value of x?
(vi) Consider the following two-dimensional array and answer the questions given [2]
below:
int x[ ]]={{4,3,2), {7,8,2}, {8, 3,10}, {1, 2, 9}}:
(a) What is the order of the array?
(b) What is the value of x[0][O]+x[2]/2]?
(vi) Differentiate between boxing and unboxing. [2]
(viii) The following code to compare two strings is compiled, the following syntax [2]
error was displayed -incompatible types -int cannot be converted to boolean.
Identify the statemnent which has the error and write the correct statement. Give
the output of the program segment.
void calculate()
String a ="KING", b= "KINGDOM";
boolean x=[Link](b);
[Link](x);
(ix) Consider the given program and answer the questions given below: [21
class temp
int a;
temp)
T24 861 7 Turn Over
a=10:
temp(int z)
a=Z;
void print)
[Link](a);
void main)
temp t= newtemp);
temp x = new temp(30);
[Link]();
[Link]);
(a) What concept of OOPs is depicted in the above program with two
constructors?
(b) What is the output of the method main()?
(x) Primitíve data types are built in data types which are a part of the wrapper (2]
classes. These wrapper classes are encapsulated in the [Link] package. Non
primitive datatypes like Scanner class are a part of the utility package for which
an object needs to be created.
(a) Towhich package the Character and Boolean classes belong?
(b) Write the statement to access the Scanner class in the program.
T24 861 8
SECTION B (60 Marks)
(Amswer any four questions from this Section.)
Te answeTS iN this section should consist of the programs in either BlueJ environment or any
program environment with Java as the base.
Eah program should be writen using wariable description /mnemonic codes so that the logic of the
program is clearly depicted.
Flowcharts and algorithms are not required.
Question 3 (15]
DIDC acorier company changes tor the courier based on the weight of the parcel. Define
a clas with the following specifications:
courier
Member vaiables: name- Iname of the customer
weight -weight ofthe parcel in kilograms
address - address of the recipient
bill - amount to be paid
tvpe -D'- domestie, T- international
Member methods:
oidaveg() tocept the details using the methods of the Scaner class oniy.
vid calculate ( ) to calculate the bill as per the followingcriteria:
Weight in Kgs Rate per Kg
Firs $ Kgs Rs. 800
Rs.700
Next SKgs
Above 10 Kgs Rs500
An aidiional amount of RsI500 is charged if the type ofthe coui
is I (Intemaional)
Toprint the jetails
Tarn Oer
Question 4 [15]
Detine a class to overload the method perform as follows:
double perform (double r, double h) tocalculate and return the value of
Curved surfacearea of cone
CSA = rl l= Vre+ h2
void perforn (int r, int c) Use NESTED FOR LOOP to generate the
following format
r=4, c5 output - 12345
12345
12345
12345
void perform (int m, int n, char ch) to print the quotient of the division of m and
n if ch is Q else print the remainder of the
division of m and n if ch is R
Question 5 [15]
Define a class to accept a number from user and check ifit is an EvenPal number or not.
(The number is said tobe EvenPal number when number is palindrome number (a number
is palindrome if it is equal to its reverse) and sum of its digits is an even number.)
Example: 121-is a palindrome number
Sum of the digits 1+2+1=4 which is an even number
Question 6 [15]
Define aclass to accept values into an integer array of order 4x4 and check whether it is
a DIAGONAL array or not. An array is DIAGONAL if the sum of the left diagonal
elements equals the sum of the right diagonal elements. Print the appropriate message.
Example:
4 2 5 Sum of the left diagonal elements =
2 2 3 3+5+2+1=11
5 3 2 7 Sum of the right diagonal elements =
1 3 7 1 5+2+3 +l=11
T24 861 10
Question7 [15]
Detine a class pin code and store the given pin codes in a single dimensional array. Sort
these pin codes in ascending order using the Selection Sort technique only. Display the
sortedarray.
110061, I10001, 110029, 110023, 110055, 110006, 110019, 110033
Question 8 [15]
Define a class to acceptthe gmail id and check for its validity.
A gmail id is valid only if it has:
. (dot)
gmail
Com
Example: icse2024(@[Link] is a valid gmail id.
T24 861 11