Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

St Poul s Hrgh School

Pre Bo rd Exum n~t on (20 .2 3,


Class 10 Computer Applications
f M w~
1 )

Section .. A (40 Morks)

• l )11 ct H' w , md writ the l ,we. t opMn


tvpt. v,, lll •1 umt • .I'S rntegf'r il w II ic fr3l tronn P~l t
t•
1 t 1i1) ont) 1\i} N n
Wn 1t 111- r1 nl vJlue stored 11 thi' v mJb c x?
1G db ... x ~ ath ce,l{Mnth obs(Math round( 3 5)))
1) 4 O 11) 3.0 111) 2 0 tv) None
Cl The blu(•pnnt that defines the variables and the methods comn .:!n to ._,f 1
certJln krnJ 1s termed as
) class 11) obJect i11) method 1v) package
o,
F nd the output
boolean a=false,b=true,c=false,
1f((a=la) && bll(c=true))
System out pnntln((a+""+b+" +c) substnng(1)),
1) truetruefalse ii) ruetruefalse 111) 1and ,i 1v) None
E Name the type of error in the statement given below
aouble a.b,c,
1) logical error 11) Syntax error 11) runtime error t\) NJ errcr
F) The operator which acts upon three operands Is known as __
i) Unary 11)ternary iii) binary Iv) None
G) Which one of the following 1s used to create an object of a class
i) New 1i) new iii) NEW 1v) both 1i) and 111)
H) A.____ method needs to be called with help of an object
1) static ii) void iii) non-static iv) class
I) The ASCII code of '1' is _ _
i) 105 ii) 73 iii) 75 IV) 107
J) Parameters used in the method call statement are_____ _
i) Actual parameters ii) Informal parameters iii) formal paramters 1v) None
K) The concept of having more than one method with different types of parameters
i) Constructor Overloading ii) Method overloading iii) both Iv) None
L) The keyword which mdicates that the method returns no value·
i) static ii) private iii) public iv) void
M) It Is a process of representing only the essential features but hiding the low level
details or background details:
i) Abstraction ii) Encapsulation iii) Polymorphism Iv) Inheritance
N1 The Jump statement that is used ms1de a method to terminate the method
1) break ii) continue iii) return iv) none
0) The method to check if a character is a lowercase letter or not is:
i) lsLowerCase(char) ii) islowerCase(char)
i1iJ isLowercase(char) iv) toLowerCase(char)
PJ The program code written in any high-level language to solve a problem 1s
1) source code ri)object code iii) machine code iv) bytecode
Q) The access mod1frer that gives most accessibility is
tJ public ii) private iii) protected Iv) 1) or 11)
R) Wrapper class available in _ _ _ _
1) Java util 11) java.lang iii) java ro iv) All
S) What wrll be the output for the following program segment?
Stnng s="Prov1dee lod1ne":1nt 1,
for(1=0 1<1.length()-1,r++)
1f(s.charAt(i++ )==s. charAt(i))
System.out.pnnt(s charAt(1));
Syatem out.pnntln(s aubstring(O,i)),
0 Pnwlda Iodine U) eProvld• locNn Hf) •Provide tod
) ,-..one

s• u ~ y fc a .: ass B('X \\ ose data me!T'bt;rS

[2~
• .: .. s h l.,e sarie methoa name what
~2]
a,d or.c +rere"'ce between wh1 a loop and do .vh ,e oop i2J

e cs ... st:l ..ed :1 x a~er evaluating the &allowing express on? [2]
x=• 5 x=++x + ·H·x ~ x+ x+~ 3 I
<:,, e •'lod orctDtype for the method creckNumber'' that take s an
•eger a ao e x as ts argument and returns a value of String data type [2]
r·e o e ~.l t of drffe e'lCe between forMal parameter and actual parameter [2]
a-,-,e .,t-e fo o:. :1g that [2]
s JSed for a ocat ~g memory to an array
s t.sed to store ·he current address of ar obJect
e ":e an ex::>,..ess :in for( a-b)' - , 25 ~ b •c 2 f2]

Section - B (60 Marks)


Attempt any four questions from this section .

.... e a:1s\ e'" ,,, t'1 s sectior should consist of the Program in Bluej environment or any
program environment with java as the base. Each program should be wr,tten usmg variable
desc riptionlMnemonic Codes such that the logic of the program is clea rly depicted Flow
:::'"'arts and Algor:thrrs are not requ rea

C4 Design a class name ShowRoom with the following description [ 15]


Instance variables/Data members :
St f' g name -T:) store the name of the customer
::, g mobr. o -To store the mob11e number of the customer
do1.,ble cost -To store the cost of the ,terns plirchased
double d s -To store the discount amount
doub,e amount - To store the amount to be paid after discount
Member methods:
ShowRoom ()- default constructor to 1rntia 1ize data members
vo d mput() - To input customer name mobile number. cost
vo d calcutateO- To calculate discount on the cost of purchase items, based on
following cntena

Cost --=---=-~
Lesstha£)_9r eqL~_I to R? 109QQ__ 5°0
- - - - - --------
-~iscq_unt(in percen~eJ_ _ _ _ __ ~
________ --------1
More than Rs 10000 and less than or 10° o
, equal to Rs10_Q00 _ _ ______ +
More than Rs 20000 and less than or 15%
equal to Rs 35000 _ __ _ _ _ _ _____
l, More than Rs 35000 _______-----1.. 2=-0:. . :o/i.;:__o_ _ _ _ _ _ _ _ _ _~

......
- To display customer name mobtle number amount to be paid
.._, mam method to create an object of the class and ca the
Q 5. Write a program 1n Java to input and store 20 temperatures m Fahrer e ~ "" a
Singled1mens10:1al array and display all the temperatures after con,ert "g
tnem ', ,"els1us
[hint ..;._,_.~s=5/9(F-32) ]

C t:5 Oes1gr a class to overload a method series() as follows


1) duuble senes(int n) with one int argument and returns the swn o~ t e se' '=S

sum=2+3+5+6+11+12+17+18+ ..... ton terms


11) double series(double a, double n) with two double arguments and re\.1ms ;":5
sum of the series.
-2. + ~ + !_ + 10 + ... .... ....... ton terms
sum- .,,_ t;.~
.... ~
a
2 a
5 8
a 11
a
Q 7 Write a program in java to input a sentence. Convert every letter of the s2:t~ :e
into upper case. Count and print the words which have at least a par of co sew· 1e
letters and if there is no word having at least pair of consecutive etters r- f r e
sentence then display a relevant error message. '" 5
Sample fnput: MODEM IS AN ELECTRONIC DEVICE
Sample Output: MODEM
DEVICE

Q 8 Write a program in java to input name and percentage of 50 stuaer•s o: o.2ss X


m two separate one dimensional arrays . Arrange studants details acco'"c ,..,g ·o
their percentage in the descending order using Bubble sort methoo [J sp a~
name and percentage of first ten toppers of the class .

Q 9 A 'Sum- product' number is an integer that is equal to the sum of ·ts c·c-:s • 'T.'es
the product of its digits. Write a program in java to input a number and che~
whether it is a 'Sum-Product' number or not. Display an appropriate messaJe
accordingly.
For Example: Number 123
Digits in the number are · 1,2,3
Sum of digits=6
Product of digits=1 *2*3=6
If sum of digits=Product of digits then tf-te numbel'" ts sad to be su~-Pr:-n:L:
Sample Input. Enter a number 123
1+2+3=1 *2*3
Sample Output· It is a Sum-Product number

You might also like