PAWAR PUBLIC SCHOOL, BHANDUP =
Class Subject Exam | Marks | Date Duration | Nev of pri
X | Computer | Term-1 | 100 | 12/08/17| 2hours | 3
Applications |
General Instructions :
This paper is divided into two sections. You have to answer all Questions from Section 2m
any four Questions from Section B, The intended marks for Questions or parts of Questions are
given in brackets [].
SECTION A
(Attempt all Questions from this Section)
Question 1 [10]
a) What is concatenation? Give an example to show how '+' operator is used
to perform concatenation.
b) What are the three types of looping statements available in Java?
c) Name the class that is used for different mathematical functions. Give an
example of a mathematical function.
d) How do you create memory spaces for arrays?
e) Write an equivalent Java expressions for the following:
1/3 a°+1/4b
Question 2 [10]
a) Differentiate between ‘if and ‘switch’ statements.
b) Give the code to extract the first and the last character of a string in Java.
c) What are logical operators?
d) Give the output of the following functions:
i) Math.floor(-126.349) ii) Math.max(45.6,17.3)
e) What are arrays?
Question 3 [20]
a) Give the general syntax of a ‘for loop’ and discuss each of its
components. [02]
b) What is an empty loop. Give an example. [04]
c) State one similarity and one difference between while and
do-while loops. [02]
d) Using conditional operator write equivalent expressions for the
following: [02]
i) Print "Even" ifx is an even number otherwise print "Odd".
ii) if (income <= 10000) tax = 0; else tax = 12 ;e) Convert the following segment into an equivalent while loop. [02]
int x,c;
for(x=10,c=20;c>10;c=c-2)
xt;
f) Give the difference between the following functions: [04]
i) starts With() and endsWith( )
ii) indexOf{ ) and lastIndexOf( )
g) Give the output of the following program: [02]
class Output2
{
static void find()
{
int n=1234, d ,s=0,c=
while(n!=0)
{
d=n%10;
s=std*(int)Math.pow(10,c++);
n=n/10;
}
System.out.printin(s);
t
h) What is Unicode? [02]
SECTION B
[You have to attempt any 4 Questions from this Section. The answers in this section should
consist of the program in BlueJ environment. Each program should be written using variable
descriptions such that the logic of the program is clearly depicted. ]
Question 4 [15]
A bike shop hires bikes by the day at different rates throughout the year. The
following table shows how the hire charge varies throughout the year:
Season _ |_ Charge in Rs.
Spring 13.00
Summer 19.50
Autumn 875
Winter 5.00
The proprietor also gives a discount on the number of days a bike is hired for. If
the hire period is greater than 7 days, then a reduction of 25% is made. For every
bike hired a deposit of rupees 50.00 must be paid. Write a program to input the
season and number of days the bike is required for and output the hire charge
including the deposit.
2Question 5 fs]
Write a ment driven program to display the following series:
i) 1,2, 4, 7, 11, 16, 22, 29, ... nth term, (Take n as input).
ii) 2, 4, 8, 14, 22, 32, ... nth terms. (Taken n as input).
Question 6 [15]
Create a method to accept a String type array as parameter and print the smallest
word in it.
Question 7 [13]
Write a program to input 10 numbers into a float type array and arrange the
numbers in descending order using Selection Sorting technique.
Question 8 [15]
Write a method to accept a name as parameter and print its initials.
Example,
Parameter-> AJAY PRATAP SINGH
Output-> A.P.S.
Question 9 Us}
Write a program to input a sentence and change it to its Title case. Title case
means to change the first alphabet of every word to capital and rest to small
letters.