Computer Applications 2020
Computer Applications 2020
(Theory)
(Two Hours)
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 [ ].
Question 1.
(a) Define Java byte code. [2]
(ii) The method which terminates the entire program from any stage.
(i) double
(ii) String
(iii) char
(iv) Integer
(e) What is an operator? Name any two types of operators used in Java. [2]
(b) State the difference between length and length() in Java. [2]
Question 3.
(a) Write a Java expression for the following: [2]
√𝑏 2 − 4𝑎𝑐
x+=x++ + x + ++y
System.out.println( s1.endsWith(''L'') );
(e) Give the output of the following program segment and mention how many times [2]
the loop will execute:
int k;
for ( k = 5 ; k < = 20 ; k + = 7 )
if ( k% 6==0 )
continue;
System.out.println ( k );
(f) What is the data type returned by the following library methods? [2]
(i) isWhitespace()
(ii) compareToIgnoreCase()
T20 861 2
if ( x > 5 )
if ( x > y )
System.out.println (x+y);
(h) Convert the following if else if construct into switch case: [2]
System.out . print(''COMPUTER'');
System.out . print(''HINDI'');
else
if(n1>n2)
r = true;
else
r = false;
Question 4.
A private Cab service company provides service within the city at the following rates: [15]
Member methods :
members to 0.0.
void calculate () - To calculate the bill as per the rules given above.
CAR TYPE:
KILOMETER TRAVELLED:
TOTAL BILL:
Create an object of the class in the main method and invoke the member methods.
T20 861 4
Write a program to search for an integer value input by the user in the sorted list given [15]
below using binary search technique. If found display ''Search Successful'' and print
the element, otherwise display ''Search Unsuccessful''
Question 6.
Write a program to input a sentence and convert it into uppercase and display each [15]
word in a separate line.
Output : INDIA
IS
MY
COUNTRY
Question 7.
Design a class to overload a method Number( ) as follows: [15]
(i) void Number (int num , int d) - To count and display the frequency of a
digit in a number.
Example:
num = 2565685
d=5
Frequency of digit 5 = 3
(ii) void Number (int n1) - To find and display the sum of even digits of
a number.
Example:
n1 = 29865
Write a main method to create an object and invoke the above methods.
Write a menu driven program to perform the following operations as per user’s choice: [15]
(i) To print the value of c=a2+2ab, where a varies from 1.0 to 20.0 with increment
of 2.0 and b=3.0 is a constant.
A
AB
ABC
ABCD
ABCDE
Question 9.
Write a program to input and store integer elements in a double dimensional array of [15]
size 3 x 3 and find the sum of elements in the left diagonal.
Example:
1 3 5
4 6 8
9 2 4
T20 861 6