.
uri ar
a mewwo e n pregor to cAlculteselected
cl tulate tthe
to reu peremetous
and as k the wsc
to shepe.
> inpot jaua.til.S can nen;
publ'e cless Chetslapeeo
Publle shtte nald meiin (sning ar[J)
Hoat , b, ea- o,
char choiee;
Scanner input = new Scan her (system.in)
System.out. pintln l"eute c tor circle');
System But pintn( ent sjen squane;
Gus tem ut- pinte l"eneatlon iamg le ")5");
Eheice <S. che AtCo)j
sith ehoice)
tasele'
System.z:eut-printnleuten sadieu);
az input. ese tFlpat ();
aree 3.14fcia;
breaki
Cese's!
Systm.out-pin tlulentsrde);
byeak;
Cas er
|sy kim. aut. printntenenleughtand boadta "))
4- ihput.neoct Flot)
bz fnput noBloat l);
arenz 0.5fas;
olijalt: ");
syslem. ut pointln ereon
bystm. eut. printlAraatna)
Van'able desepion
Vaiable hame descgtion
case C, Case'e
a float a
the cicle
ase's
foat to stone
oat to slone ogt
b to stoe bredt
Caset
foat aiangle
foat b to stone base of
wanga
a.To check we the asting is pal'nelome on uot.
fmport jaa.utl.*}
puslie clas palinrom
Sriny original, es:jllebjeck Stig elass .
Acannen in- ew sCannn (Cyam. in ))
bysem.out printn C"entecu shing bcheckitisa pelindea)
ton linti lnlut -Giyoji--)
ense eners toiginal. clan #tCij
if Coriginal.eals ense
Sys tem. et. printten ntreel),sthing ísapalineromtt);
else
Vaniable dasoptfon.
raiable nae Qetrption
owiinal to storeShing );
enteeol b de
int to stoe leng,
t doop vaable
to soe
topesq
+hm24" operatont + Yétnj
oferato" ) eng entel System.et.
print
f detault:
dae ("Yeu
breakj
2
/hwmlj ml output
'y': Case
break÷
boeaej
m?j ml eutput
l; Case
breahj
Casel4
loperaton) Suitch
put} otdeuble
SCarnher.close
COj
t0);SCpnn,wtCl.
cen opewtor Ghar
*,D");
enopeutor(t,-, printlal("eter Sytem.et.
Deuble()}$enmneresct heLm2
wwben
; SeCond
prindln("entea but. System.
l); DeubleemlStannen
besct t
umben"); yirsflhenter S
cannenlSyskn.in); ew-priht
Caneryetm.QutSCannens
mej eml, loble
LJ)f ansys(Stlng wein weld tatte Puslies
3 lass clic Pub
.*) util jahe. Tmpent
Cese Blth a
the wsngaleulaor a keprooam
matoto jama wita 3.
Vaiable desoipte
tarabesescpion
palhlype
double fist numbes
olousle
seconelnurbon
Operato
Cha
opeatos
which t e
eke eleclion
blocK to
Case
be execued
-nt sign
4. Computt the natwrel logarhm ef, by aelelin up to
uhre is a poitne intyer nolinp by sn.
i mport jave. til . *)
Public class Pi4
pub lie slabe rod matn Csting angstI)
Scamner Console- hewSanner CSstem.atprt
nt mben
Sya tom. eut.pint "emton heumbe oy temsejseies');
hunb en Coneole.hest Int))"
double Swm Dj
i wt sign l) ember;ít+)
bon l int i 1; i
sumao*sigu) /ij
sign
pintln("Log2: sum);
Syslen.at
3
Vaieble dssciphon
Vaiable nannd Desiplion
int
Sum
deusle
nt deviantarticomitsukineeur
5. we a poesarn to enecutc tue oleui ga ton
an in teen n
(tCI+2) +Cl+ 2+3).CTE2+3...+n)
-) class Pl2
sttie int sumsen Cintk)
bon fnt't |;i<s kj it+)
Sst!)
7etwn Sj
3
Cttle nold sertes (intn)
SonCint i-1ji<<nj i++),
Sum=swm t SUAAlci;
printlnll+ C142)+C142)+(42 3.+n=
Systeom -ct.
3
Doy n To lndleestand e progam tws hudy
Hos solloi'g tabe toaking valne e n ó Suma
STDIX VEAD nA r
value etend by
IL3-4
3
R Vanioable doupriplion
aejiagleMine
Bsoption
int loep vayeble
int Bum
int S to stoe erns
6. ile a preca o display a paten as tollows
1
-- 12 3
4 23 h 5
class patena
veid display Cint n)
yon Lit i-1ji
<=njjt+)
L System. out. printl" "):
tonlintK-IK-ijK++)
Sysem,et. printL;
System,out .printlnl );
Vaiable des iphiog
Laeeble name peswplion
puter oop laeinlla
int
int
to print Jpace
ianes loep
aiabte to rint
pattnn
2 3 uSG 7
2 3 us b
2 3 uS
| 2 3
|23
2
2 3
’imp nt faa. uttl. j
fublic. class Main Cla
Publ?e statte veid main Cslng angs)
Scannn sC 2 nlw ScannelSystem.in)i
Sustem.eut.p fntenHow many oous yoawant in
Auis pattean
System. out.printen l"Hene s yopattun...!!;
fonint|rous)i |; |--)
Sen Cintj l;j=i)jt+)
Sgs term, Gut. Piytnl;:
Sys tem.out.poirlncj
donenti=2) i<res,it+)
fonl lntj- 1, j<i; j++)
System.cot-prin tlj+" );
Syatem.out. psitlnl)j
Se.ctosel)
Vaeiate name peonplion
nt aiase
anes loep
int asiatla to print
PAttern
to Stoe
int
8. To deti ether e aln embe
isamateg
whose Sum the cbes teir a°bis aeel othe
oitnal onl. er escaaple ls 3, 37o,
’ 31, ho7
publle class p8
Puo l'e ckt'e naid main
(sting anys LI)
int nl nj
b 2 = 0j
int d;o
lile (n o)
n2 = n2 t d* *d
n n )o;
f Cn2= M1)
System . ut. printlnl" Amstong niber" ) :
elue
Ays em ot -pri'ntln ("Net Amstony hunber);
33
A Vai able De Cipkion
aiatlo name
Qeseipton
int to slone vale K
nin n|
n2
int
to stoe digit
Q D
n2tel
n>on'tlD2
n= nlo
bt333- 27
IS3 t
t
2745;5-(52
Wte a Droytam to caleulet Hue Sales comssion sales man
depen 9enthe yolleun ng ch° kia
Sals(INA) Cemmiss lon
27.
> 50p00 and<-2,00,00
-).
public cles Bales Comm
publie slatic veid main
double bals = )ooo00;
dauble comm 00,
4 (Sale 50000)
Conm dales O.02;
D02}
AL salls<= 20D0DD)
bluei ( bales >= 6000D
005
Comm - dales
else 0. o1
Comm dalls
Dt printhl"dale-"+dales).
printa"Comnission="tcoram)
3
vaiatle name
Dcse nptisn
olousle bales to stoe dales
dousle lomm to ste Comnibioy
to dales
to. write a java prom to caletat tw grades of a ehudeut w.
the markas ay ee stuclent ane inpt. iradutollowt u folouut
hg talle
Manks Caradas
pubic cls tulent
pubeie static void main lshig age)
int mas = 99;
Shing Gmade
Gade= "8'":
Goade 'c';
Cmaus =45)
alseif
Gande-"e',
Systin put . printn (" maiks ="Hmat);
STDIXYEAR not (page
nolindrome or
-i
Vaniable description
desngion
|ape
ent
Gades
tothe
mats
nria.