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

Do(m)Name

(vi) (v (i) Question


Choose CLASS:X
() 24/06/23
1DATE:
(vii) (iv)
errorno
d. C. d. C. b. d.1 bytesAbstraction d.
Encapsulation Name
logical
runtime a. a] d. b throughfalle.
dangling
default else
C. b. a.The bytebytes C.
2 bytes
Polymorphism
Number
b.4 a.8 Inheritance
c. b. a.
next() a.The syntax voidName
d b. average[int Constructor continue
Overloadedconstructor
parameterized
non-parameterized
constructor default
constructor
constructor condition the
method the
the the correct
of ability
type one bytes
of
that
that which
Scanner of occupied answer
which
error, is
supplied occurs
is allows and ST.
class if a PATRICKS
any in shorthand by APPLICATIONS
COMPUTER
by the write
used the an 2023-24
CYCLE
TEST
in the absence
the literal object the
to compiler assignment
following: SECTIONA
correct ACADEMY,
accept true to
of take
is a are:
a break option.
boolean called on
operator:
many ANGAMALY
statement
value forms
is: at called?
the
end
of
a Time:1hr 40
M:
M.
case.
[10]
D () 2
(iii) (ii) Question (x) (ix) (VIii)
(i) variables/Data
Member
methods :members: Question 8
InstanceDefine (v) (iv) What new d. assignment
b.
voidbreak d. relational
a.The assignment
logical a.nextBoolean()
nextDouble()
c b. nextline()
b=9.5; NaN .-5.0 a. return . The d. C. b.
) jnt i>=0;i--)
for(int RewriteWrite Evaluate
i=20;double
String
Bookfair() doubleBname Find a keyword
a How (--d>0)
while d-9; += value expression
class the the
many the --b+ the
output:- java d. 5.0 b.
- price named System.out.println(i*10+b);
System.out.print(d); wil that
followingexpression:-
C++ None
Default -stores Write times expression Math.sqrt(-25) is
which
storesBookFair + of used
constructor
Math.ceil(-3.2)+Math.abs(-2.3)
variable the for b++ these uses
the the loop to
loop for: *Cint &&
with send
pricename is a=2, return?
description using a operator
to of the executed (a)/(m+n) b=5,c=9 value
initialize of while
the tfollowing
he SECTIONB
from is
book book
for and loop? known
data the what the
description:
members given function. as:
is
the
programs
output?

(10] [2] [2] (2] [2] [2]

(i ) void Dok
(ii) BookEair(String x, double y)-Parameterized constructor to initialize the data members.
the priceof the hook
(i)void input() - To input and store the name and
(i)yoid calculate() -To calculate the price after discount. Discount is calculated based on
the following criteria.
Discount
Price
Less than or equal to Rs.1000 2% of price
More than Rs. 1000 and less than 10% of price
or equalto Rs. 3000
More than Rs. 3000 15% of price

discount.
(iv) void display() - To display the name and price of the book after member methods.
Write a main method to create an object of the class and call the above
Question 9
Define a class PhoneBill with the following descriptions: [10]
Data Members:
CustomerName String
phoneNumber long
no of units int
rent int
amount float
Member functions:
1. A
constructor toassign initial values of customerName as "Raju", phoneNumber as
259461, no of units as 50, rent as 100, amount as 100.
2. calculate() :This member function should calculate the value of amount as rent + cost
for the units.
Where cost for the units can be calculated according to the following conditions:
No _of_units Cost
First 50 calls free
Next 100 calls 0.80 @ unit
Next 200 calls 1.00 @ unit
Remaining calls 1.20 @ unit
3. Afunction accept() which allows user to enter customerName ,phoneNumber,
no of units and rent and should callfunction calculate().
4. A function display() todisplay the value of all the data members on the screen

You might also like