Member methods:
void accept()—
void caleulate () ~
void print()—
void maing) —
Question 4
accept the details using scanner class
to calculate the net salary as per the given specifications:
net = basic +hra+da~pf
hra = 18,5% of basic
da= 17.45% of basic
pf= 8.10% of basic
if the age of the employee is above $0 he/she
gets an additional allowance of Rs.5000.
to print the details as per the following format
eno ename age, basic net
to create an object of the class and invoke the methods
eloot Overload
Define a class to overload the method print as follows: F
us]
void print ()—to print the format 1
boolean print (int n) —
void print (int a, char ch)
fCcneesil|cn-2S)
Void print
tok come VP een At)?
ae fox (ant i= FS niet)
456 4 rie
sor ne
789 10 Joma
to check whether the number is a Dudeney number ,
a number is dudeney if the cube of the sum of the bpablegn pa\el(nty)
i oeetAteo T
digits is equal to the number itself. int d= A107
Bg: 5125 (S4142)3 = (693 =512
iftch = or S print the square of the number else if @="L/i0 ;
ch =corC print the cube of the number.
+ chsee ine resul
SOP(Squaxe ayer + @xa)); ifowwn
else ip(ch=se'ilch-e') as ¥ Bore ts ;
Questions SOPCGule ‘rat’ + Qxa%sa))s } us) > Deda
Define a class to accept 10 integers and arrange them in descending order using bubble eee ore Nok a
sort. Print the original array and the sorted array. ews
Question 6 fs)
Define a class to accept values into a double array of size 20 and print the range of the
array, range isthe difference betiveen the largest and the smallest elements ofthe array,
[23 861 SPECIMEN Soto
(& scanned with OKEN Scannerie Stabe vel vin Shaing augst)) ‘
Sayer Segoe acs ans i) nea Stingpusides 6)?
eae © mn
OP (6 wiv ne inl 8 Steg eulde eas taing’)
Int hov = 0;
Seaton Gx Got i nae langind) pi+t) “09
a micron fea