Professional Documents
Culture Documents
COMPUTER APPLICATION
Grade: 10 Duration: 2 Hours
Date: 09/01/2020 Max. Marks: 100
[The time stated above is the time allowed for writing the examination. In addition,
the first 15 minutes will be the time given for reading the question paper.]
All working, including rough work should be done on the same sheet as rest of the
answer. The intended marks for questions or parts of questions are given in brackets.
Section A
Answer all questions
Give examples and briefly indicate the working or reasoning.
Question 1
a. Differentiate between static and non-static data members in a class.
[2]
Question 2
b. List the variables from those given below that are composite data types. [2]
(i) static int x; (ii) arr[i] = 10; (iii) obj.display(); (iv) boolean b;
(v) private char chr; (vi) String str;
c. State the value of characteristic and mantissa in the following code snippet. [2]
String s = "4.3756";
int n = s.indexOf('.');
int characteristic = Integer.parseInt(s.substring(0,n));
int mantissa = Integer.valueOf(s.substring(n+1));
Page 1 of 5
d. How are private members of a class different from public members? [2]
e. Consider the following String array and give the output: [2]
Question 3
Question 4
(a) State two differences between an Arithmetic Expression and a Logical Expression. [2]
Question 5 [15]
Accept a positive integer from the user and check if it occurs in the Fibonacci series. A
number is said to be a Fibonacci number, if it occurs in the Fibonacci Series.
For example, if the user enters 6, then it should display the message, “6 does not occur
in the Fibonacci Series. If the user enters 21, the program should display the message,
“21 occurs in the Fibonacci series”.
By definition, the first two numbers in the Fibonacci sequence are 0 and 1 and each
subsequent number is the sum of the previous two.
Fibonacci Series: 0,1,1,2,3,5,8,13,21…etc.
Question 6 [15]
Write a program to merge two single dimension arrays as shown in the following example
and display the merged array.
For example if,
Array X has the values: 5, -3, -2, 1, 0, 12, 14, 16, 25, 13
Array Y has the values:6, 5, 10, 15, 18, 20, 22, 30
Arrays Z should have the merged values as shown below:
5, 6, -3, 5, -2, 10, 1, 15, 0, 18, 12, 20, 14, 22, 16, 30, 25,13
Question 7 [15]
Data Members:
String name : stores the consumer’s name.
char cust_cat : stores the customer category Residential or Industrial (R or I)
int prv, pre : stores the previous and present meter readings respectively.
int unit : stores the unit consumed
double amt : to store the amount.
Member function:
void input () : to accept the name, category, previous and the present reading
void calc(): Calculates the units consumed using the previous and the present reading
and also the amount to be paid based on the tariff rates shown below.
Page 3 of 5
Residential
Consumption (kWh)/ month Slab tariff (fils/kWh)
0-2000 23
2001-4000 28
4001-6000 32
6001 & Above 38
Industrial
Consumption (kWh)/ month Slab tariff (fils/kWh)
0-10000 25
10001 & Above 38
Accept the customer details, calculate the bill amount and display the bill by creating
objects in main().
Question 8 [15]
A class called numbers has the following overloaded functions:
Question 9 [15]
Write a program that displays a menu and executes one of the following based on user’s
choice.
MENU
a. PRINT SUM OF THE SERIES
b. PRINT PATTERN
c. Exit
a. Input the values of x and n from the user and calculate the sum of the following series
and display the sum
Sum = 1 / x2 + 4 / x5 + 7 / x8 + 10 / x11 + ……. to n terms
b. Print the following pattern
1 5 9 13 17
5 9 13 17
9 13 17
13 17
17
Page 4 of 5
The program should repeat as long as the user wishes to continue and it should terminate
when the user chooses option c.
Question 10 [15]
Write a program to fill a matrix with the following data and display the matrix as shown
below.
1 2 3 4 5 6 7 8 9 10
2 4 6 8 10 12 14 16 18 20
3 6 9 12 15 18 21 24 27 30
4 8 12 16 20 24 28 32 36 40
5 10 15 20 25 30 35 40 45 50
6 12 18 24 30 36 42 48 54 60
7 14 21 28 35 42 49 56 63 70
8 16 24 32 40 48 56 64 72 80
9 18 27 36 45 54 63 72 81 90
10 20 30 40 50 60 70 80 90 100
**************************************************************************
Page 5 of 5