Computer Applications
General Instructions :
• Answers to this Paper must he 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 [40 Marks]
(Attempt ALL Questions)
Question 1.
(a) Name any two basic principles of Object-oriented Programming.
(b) Write a difference between unary and binary operator.
(c) Name the keyword which :
(i) indicates that a method has no return type.
(ii) makes the variable as a class variable.
(d) Write the memory capacity (storage size) of short and float data type in bytes.
(e) Identify and name the following tokens :
(i) public
(ii) ‘a’
(iii) ==
(iv) {}
Solution.
(a) Abstraction and encapsulation are the basic principles of Object-oriented
Programming.
(b)
, Unary Operators Binary Operators
(i) The operators which act upon a (i) The operators which require two
single operand are called unary operands for their action are called
operators. binary operators.
(ii) They are pre-increment and post (ii) They are mathematical operators
increment (+ +) and relational operators.
(c)
(i) void
(ii) static
(d) (i) short: 2 bytes
(ii) float: 4 bytes
(e) (i) keyword
(ii) literal
(iii) operator
(iv) separator
Question 2.
(a) Differentiate between if else if and switch-case statements. [2]
(b) Give the output of the following code : [2]
String P = “20”, Q = “19”,
int a = Integer .parselnt(P);
int b = Integer. valueOf(Q);
System.out.println(a+””+b);
(c) What are the various types of errors in Java ? [2]
(d) State the data type and value of res after the following is executed : [2]
char ch = ‘9’;
res = Character. isDigit(ch) ;
(e) What is the difference between the linear search and the binary search technique?
[2]
Solution.
(a)