Academic Year: 2021 - 2022 Examination: Initiation Month: JULY 2021 Class: 10 Maximum Marks: 100
Academic Year: 2021 - 2022 Examination: Initiation Month: JULY 2021 Class: 10 Maximum Marks: 100
Examination : INITIATION
Month : JULY 2021
Class : 10
Maximum Marks : 100
____________________________________________________________________________________
COMPUTER APPLICATIONS
(Two Hours)
____________________________________________________________________________________
Answers to this Paper must be 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 [ ].
_______________________________________________________________________________________
_______________________________________________________________________________________
This paper consists of 6 printed pages and no blank page Turn over
Question 2
(a) What are the values of a and b after the following function is executed, if the values
passed are 30 and 50:
void flew(int a ,int b)
{
a=a+b;
b=a-b;
a=a-b;
System .out.println(a+","+b);
}
(b) What is the result produced by 2 – 10*3 + 100/11? Show the steps. [2]
(c) What will be the output of the following code? [2]
int m=2;
int n=15;
for(int i = 1; i<5; i++);
m++;
--n;
System.out.println("m=" +m);
System.out.println("n="+n);
(c) Differentiate between break and System.exit(0). [2]
(e) What is the value of m after evaluating the following expression: [2]
Question 3
|(a 2 + b2 )/2ab|
_______________________________________________________________________________________
2
(b) What are the types of casting shown by the following examples: [2]
(i) Math.pow(25,0.5)+Math.ceil(4.2)
(e) State the type of errors if any in the following statements: [2]
(ii) System.out.println(100/0)
(g) State the difference between do while and while loop. [2]
(h) What will be the output of the following program segments? [2]
(i) int a = 0;
a++;
else a-- ;
System.out.println(a);
(ii) int a= 5, b = 2, c;
if (a>b || a ! = b)
c = ++a+--b;
System.out.print(c+ “ ”+a+ “ ”+b);
(i) Give prototype of a function search which receives a sentence sentnc and a word wrd and [2]
returns 1 or 0.
_______________________________________________________________________________________
3 Turn over
SECTION B (60 Marks)
Attempt any four questions from this Section.
The answers (to the programs Q4-Q9) in this Section should consist of the Programs in either Blue J
environment or any program environment with Java as the base. Each program should be written using
Variable descriptions/Mnemonic Codes such that the logic of the program is clearly depicted.
Flow-Charts and Algorithms are not required.
Question 4 [15]
int days - to store the number of days the bike is taken on rent
Member methods:
(i) To find and display all the factors of a number input by the user (including 1 and excluding
number itself).
Example:
(ii) To find and display the factorial of a number input by the user (the factorial of a non–
negative integer n, denoted by n!, is the product of all integers less than or equal to n.
Example:
Sample Input : n =5
Question 6 [15]
Using the switch statement, write a menu driven program for the following:
(i) To print the triangle [Given below]
1
2 2
333
4444
55555
(ii) To display the following pattern
1
21
321
4321
54321
For an incorrect option, an appropriate error message should be displayed.
_______________________________________________________________________________________
5 Turn over
Question 7 [15]
Write a program to find the sum of the following series depending on the user choosing 1 or 2:
1. s = x/1 - x/2 + x/3 -x/4 … up to N terms.
2. s = 1 + (1/3) + (1/5) + …… + (1/19)
Question 8 [15]
Write a program to input a number and check and print whether it is a Narcissistic Number or not.
Narcissistic number: It is a number that is the sum of its own digits each raised to the power of the number
of digits.
1634=14+64+34+44=1634
Question 9 [15]
An electronics shop has announced the following seasonal discounts on the purchase of certain items.
Write a program based on the above criteria to input name, address, amount of purchase and type of
purchase (L for Laptop and D for Desktop) by a customer. Compute and print the net amount to be
paid by a customer along with his name and address.
(Hint: discount = (discount rate/100)* amount of purchase
Net amount = amount of purchase – discount)
_______________________________________________________________________________________
6