Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Practice QUESTION PAPER 1

COMPUTER APPLICATIONS

Maximum Marks: 50

Time allowed: One and a half hours

You will not be allowed to write during the first 10 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.

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.)

Question 1

Choose the correct answers to the questions from the given options. (Do not copy the question, Write
the correct answer only.) [10]

i) When an object of wrapper class is converted to its corresponding primitive datatype, it is


called as ___________.

(a) Boxing
(b) Explicit type conversion
(c) Unboxing
(d) Implicit type conversion

ii) Identify the incorrect statement from the options.


a) String p=”hello”;
b) String s=new String(“hello”);
c) String p[]=new String(2);
d) String t=123+””+341;

iii) What will be the output of the following code snippet?


System.out.println("GOOGLE".charAt(1)+"AMAZON".lastIndexOf('E')
+""+"CHROME".compareTo("CHROM"));
a) Compile error
b) 780
c) 781
d) 7-11
iv) What will be the output of the following code snippet?
char c='A',b=c++;
System.out.println(b);
System.out.println(c+b++);

a) A
130
b) B
131
c) 66
131
d) A
131

v) Which of these is an incorrect Statement?


a) It is necessary to use new operator to initialize an array.
b) Array can be initialized using comma separated expressions surrounded by curly braces.
c) Array can be initialized when they are declared.
d) None of the above
vi) Class String resides under which package?
a) Java.util
b) Java.io
c) Java.lang
d) Java.math
vii) Which statement is correct for protected access specifier?
a) Protected members can be accessed only by classes and subclasses in same package
b) Protected members can be accessed by sub classes in same package and classes in
other packages
c) Protected members can be accessed by classes and subclasses in same package and
sub classes in other packages
d) Protected members can be accessed only by classes and subclasses in other packages
only.
viii) What is the output of the following code fragment?
int [ ] odd = {1, 3, 5, 7, 9, 11 };
System.out.println(odd[1]++ + --odd[3]);
a) 5
b) 9
c) 8
d) 7
ix) Which one of the given method prototype is returning base address of the String array
passed as parameter?
a) String call(String [])
b) String[] call(String a[])
c) []String call(String[] a)
d) None of the above.
x) What will the following statement display?
String t=""+Character.isLowerCase('A');
System.out.println(t.charAt(t.length()-1));

a) Compile error
b) Runtime error
c) c
d) e

SECTION B (Attempt any four questions.)

(10x4=40)

2. Write a program to accept a sentence terminated by ‘.’ And display all the words whose sum of ASCII
values of the vowels is odd. If no such word(S) exists following the logic add an appropriate message.

3. WAP to store n words in an 1D array and display all the words by interchanging all the consonants in
the word with its next vowel in the alphabetical series. Words are taken in mixed case. If a word(s)
doesn`t contain any consonant then display the word only.

4. WAP to create two arrays of size 10 where one array will store name of the employee and other will
store basic salary of that employee. Accept a name from the user and check whether the name exists in
the given array. If exists display the basic salary of that employee otherwise give error message.

5. WAP to accept 10 numbers having atleast 3 digits in an array and for each element in the array display
the sum of digits which are prime. If no such digits in the number is prime then display the product of
the first and last digits of the number.

6. WAP to accept a name which contain first name,middle name and last name. Display the name in the
following manner given in the example. Take the name as input from the user.

Input: Ashis Kumar Gupta

Output: A.K.Gupta

You might also like