Computer Applications Specimen 2020
Computer Applications Specimen 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 encapsulation. [2]
(b) Explain the purpose of using a ‘new’ keyword in a Java program. [2]
Question 2.
(b) Rewrite the following condition without using logical operators: [2]
if ( a>b || a>c )
System.out.println(a);
(c) Rewrite the following loop using for loop: [2]
while (true)
System.out.print("*");
(d) Write the prototype of a function search which takes two arguments a string [2]
and a character and returns an integer value.
Question 3.
(a) State the number of bytes and bits occupied by a character array of 10 elements. [2]
(b) Differentiate between Binary Search and Linear Search techniques. [2]
(e) What is the value of m after evaluating the following expression: [2]
m - = 9%++n + ++n/2; when int m=10,n=6
(i) Math.pow(25,0.5)+Math.ceil(4.2)
(i) "TRANSPARENT".toLowerCase();
(ii) "TRANSPARENT".compareTo("TRANSITION")
(h) Write a java statement for each to perform the following task: [3]
(i) Find and display the position of the last space in a string str.
2
(i) State the type of errors if any in the following statements: [3]
(ii) System.out.println(100/0);
Question 4.
Anshul transport company charges for the parcels of its customers as per the following [15]
specifications given below:
3
A surcharge of 5% is charged on the bill.
void print ( ) – to print the name of the customer, weight of the parcel, total bill
inclusive of surcharge in a tabular form in the following format :
Define a class with the above-mentioned specifications, create the main method,
create an object and invoke the member methods.
Question 5.
Write a program to input name and percentage of 35 students of class X in two separate [15]
one dimensional arrays. Arrange students details according to their percentage in the
descending order using selection sort method. Display name and percentage of first ten
toppers of the class.
Question 6.
(i) int Sum(int A, int B) – with two integer arguments (A and B) calculate and
return sum of all the even numbers in the range of A and B.
(ii) double Sum( double N ) – with one double arguments(N) calculate and return
the product of the following series:
(iii) int Sum(int N) - with one integer argument (N) calculate and return sum of
only odd digits of the number N.
Write the main method to create an object and invoke the above methods.
4
Question 7.
Using the switch statement, write a menu driven program to perform following [15]
operations:
(i) To Print the value of Z where Z = 3+0.5
where x ranges from – 10 to 10 with
Example: If N = 5, Output:
23
456
7 8 9 10
11 12 13 14 15
Question 8.
Write a program to input and store integer elements in a double dimensional array of [15]
size 4×4 and find the sum of all the elements.
7 3 4 5
5 4 6 1
6 9 4 2
3 2 7 5
Example:
Input:
Output :