You are on page 1of 2

KRISHNAGAR ACADEMY

TEST EXAMINATION
Class: - X
Subject: - Computer Application
Time: -

Marks:-100
SECTION A
Answer all the questions in this part
While answering questions in this part, indicate briefly
youre working and reasoning, whenever required

Question 1:
a) Class is a user defined data type. Explain.
b) What will the following function return when execute?
a. Math.rint(17.6);
b. Math.ceil(-7.8);

[2]
[2]

c) Explain the term for loop with an example.


[2]
d) State the difference between Constructor and Method.
[2]
e) Explain with the help of an example, the purpose of default in switch statements.[2]
Question 2:
a) Difference between operator and expression.
b) Explain the meaning of break and continue statement.
c) State one similarity and one difference between while and do while loop.
d) What is call by value?
e) Write a statement to perform the given task:
a. To generate random number between 0 and 1.
b. To find the value of Sin300.
Question 3:
a) What is fall through? Give an example.
b) Write down the syntax to perform the following:
a. to create a Scanner object.
b. to accept an integer through Scanner class
c. to accept a word through Scanner class
c) Differentiate between isLowerCase() and toUpperCase() methods.
d) What is function prototype?

[2]
[2]
[2]
[2]
[2]
[3]
[3]

[2]
[2]

Question 4:
a) Enter any two variables through parameterized constructor. Write a program to
swap and print the values.
[4]
b) Predict the output for the following functions:
String st1= India;
String st2= wins;
String st3= World Cup Cricket 2011;
i)
System.out.println(st1+st2+st3);
ii)
System.out.println(st3.length());
iii)
System.out.println(st3.substring(0,10));
iv)
System.out.println(st3.charAt(0)+st3.charAt(6)+st3.charAt(10));
[4]
c) What do you understand by return statement in a method? If a number of return
statements are used in a program, how many of them can be executed at a time?[2]

SECTION B
Answer any four questions from this section.
Each program should be written in such a way that it clearly depicts the logic of the
problem. This can be achieved by using mnemonic names and comments in the program.
(Flowcharts and Algorithms are not requires).
The program must be written in Java.
Question 5:
An electricity board charges the bill depending on the number of units consumed as
follows:
Unit consumed
Rate Per unit
First 100 units
40p. per unit
Next 200 units
60p. per unit
Above 300 units
Rs. 1 per unit.
Write program in Java to print the bill for consumers of a town. Assume that a meter rent
of Rs. 500 is paid by every customer.
[15]
Question 6:
[15]
Consider the string as:
India wins cricket world cup.
Write a program to accept a sample string and delete all the vowels present in the string.
The program also counts deleted vowels and the new string is displayed as:
nd wns crckt wrld cp
Number of vowel deleted = 8
Question 7:
Write a program to input ten numbers, and count how many are Krishnamurthy.
(145=1!+4!+5!)
Use the following functions:
inputs(): Inputs ten numbers from the user using InputStreamReader.
factorial(): Returns the factorial of a number.
iskrishnamutry(): Checks if a number is Krishnamurthy.
main(): Main function in the program.

[15]

Question 8:
Accept the names of 'n' animals in a one dimensional array. Sort these animals
alphabetically using the Selection Sort technique only.
[Eg: If inputs= Cow, Cockroach, Crow, Cat, Camel, Calf, Centipede.
outputs= Calf, Camel, Cat, Centipede, Cockroach, Cow, Crow.] .

[15]

Question 9:
[15]
Write a program to accept the name of the user and print the abbreviate form of the name.
Sample input: Netaji Subhash Chandra Bose.
Sample output: N. S. C. Bose.
Question 10:
Write a menu driven program to display the sum of the following series:
a) S = 0+3+8+15+-------------------------------------- to n terms
a 2 a3 a 4
b) S = 1+
+
+
+ to n terms
1! 2! 3!
Tanmoy Das
Krishnagar Academy
9434188851

[15]

You might also like