You are on page 1of 5

ssignment-

6.wte a program to fino ouf area ot cincle


7imort ava. ufil.Scannen,
clos Areo
public Staic void man(Steia angst,)

Scamen (Syslem. in):

Sys tem Ouk prinfln C"Enten the radr of fhe


cede:")
s c . nentlot C)

double anea: 3.14 rxnj


mOutut preintln The area ot cincle is

42 Wle o proaram to Fino 5imple interes


closs 2nlenest
Poblie Stahc voio main s teing auI)
nP4 3
froot dotblg re
SCanne S
stem. Ouk print CEn ten
new SConn en (Syghem .in)
the
P shetInt paintipal value ") :
System Out. prinf CEnten the fime peniood )

Syshem 0uf prrinf(Egten the rale of interest.').


T SC nert tloaF c
T ( T J x p)/lo0
Systom Out prinfln CThe Simple 1nfeneßd s
Asign.ment-2
fe o? fne
progran to find out
sum
Cai: farcecte Wik a

publie Shafz vaid olgis o f a numbén.


man s/ring
yble tesius , Faknenhet;
) class Sum
:
voio main (Sysieas
puipte Statie
Sconnen Sc ned Scann@rt Sfin1.
Sstem ouf. printlo C Enter temp¬taftune
ahrenheit: ") 2i Sconne Se = e Econer

he nunitre
Fakrenhdt sc.ne »t auble Sysemou peind l nven
S ne2 );
celsiu (fahrerhet32) o.5ss) um

SysknCut ruinf in Tempe vatne i *o.5556) while (n um >o)


celsiu + Celsiu); dig f num 10
Sum Sum+

num num /10


4.Wnitee a podgnam to shru the ue of Comman

ne anguments l"Sum of haia: 4sum)


Sysen Od-peiottn
clous Conmand
Poblic
SBaic oid mar string argsc){
int
inf Counf ,i :o;
O
a pdogrndm
injawa to n o alsf
wae
Steing sr aufdru'at a numben.

Cunt angs.levath; clotsfacferda


ystem. Cuprinfin nmber t an qineats va'd man ( sining argsc1)
poblie slaie
ount);
wh:le i Count ) Sconren ( S48te.jn
Se ne
SCanngr
Eotor 1he numbe
stre rgs Li13 Sstem ous. prot
i nt num Sc.nent
Int ( ,
Syeiem. tut.prioflo( i+ "jave +ste) Tor 1i<:nurnt++)

2 4at4at *is
l'rastraiak ot nur
Syherout. riotlo
cheK 2
numben
i n d r t om

lass alin deort


publetahe voidmaio (String
ang r3) la
Cegal , ro vrse break

Seonnt sc -

u d printin
nen) Stornen

tokern
(ftrid
anum hen to
ge,) else
chesh:

Cgioa sD@ntline t)
Lngth Orig.nol.Lerah
fornf ' longth -I i i > :o- og)
Sysden. ou preinf tn The ",
n se +Orinal. chor H PumbCn")

Oriinasqualg Crevere))
else
Sshem Ouk. println Enterted rumber t

Opalinelrome Syedem oub peinfIn The 4


porime number
else
mbens
Sysdem.ous prinf ln iniensd6
nat a pal indro m e

to pin the 1akonare


e poaram
Jerue
Tne a pntgmar to chek whefher umbe class fabo natt
preime o n not poblie Siati yoiol main (Strig or go 1)
in o : 0,n2 1, n,i, ( ount :h
Clotr PimeCr nilot ) f
stah v'd maln (hing re "

Publie
m-Ou print ( n4 4n?);
for ( 2; ittoudfi)f
yeteOut. peirlo(rotr 6unumb

nitn2,
farnen se re Seannenlsyeten, in ), Syshemdulprinf an
whe a Java prognarn calkulete pau C 1)
4
ing claus.

class Power
StoAC nt wen ( iot hase, int exponent)/
6 wnite a Java progrom 4 Swae the dat
the data
membern of an
okject. inf pauer:
or Cn4 is lj #k: eponent ?t++)
clos Con poert power * hade
retunn 12wer
no
Con Cind no)
Public Stahc Voiol main ( String arastT)S
thi3. n0 n0, in base, eponent N
Scon nest 3 ned Seonnen System.in)
thod uges Con objecds
stem Ouspruinf Cnten the base: ")3
clasg
hase SC. nertlnt C;
class aig Car c', Cor C2 Systern. Oul.prinf ( En ten the erpone
3 wap
publ'csBahc vold manSeinq orgsts)
enponent Sc. nert 1n t(

pouw powen (bae, erponent),


emp Cl. no
e no C2.nos System out.printn( base +"9g thepoen "+
euponent + "? g "+ pad )
C2 n0 teme

pubie Stat vo'o madn (s ring orgsc )


4:8 We a ava to Finoloud anea ot a triangle
Car tu nev an (f) trienle
reetongte one cinule
cuing mefhoo averloaslg
Can 2 ne (ar (e)
Closs Cale alole f
Swop ci, CE);
Vo'd Anea ( nf b, infh) ?
ystem Oal potntincrno cl,no
cz.no E '+ c2. no),
Ioas
Sygtemnous.Print arO.5 t b th
SHem Cut.pruinf ("Area 07 trarg?e*
osib)
h e r a ( fat L,
Isat clau Tdust
L b inf ptds

Systsm. Cu.print
CArea
rectongle "+ Strirg
pname
model ;
odobe pr' Ce,
Void hreaCint t)
Peodut Crt int pid, sirig pra , ng pr
lead 03 deble peie) {
O3 3,l41t*T
this pid pid
StemOuk-print Area ef cincle -",.
"403)5 hi9 pnome prome
this. penelel pmdes,
c lass Demo 4h' prote pre
Dublie Statit Vool' maun(Strung Ogat) iot gefp:d t f
CalGelahe retun pid
c new Cadulale )
C. Area Cio,to )
.Area 10.5, 20 .5)
getnamets{
returt pname 5
tAnea( 10)

rnggeffnlet f
G1 Wre a java Program fo d'splay palur retunn pmole!
letail( prucluet iol,produtt namey prooluer dasble geHPrte cof
méolel and pavdust price) or n oo 0f
rehurn prite;
podutS.
clasodut Publ'e stak'e Voio d:s playfoamat t
emOuf prin o m , Name Moolel
Roame praey

You might also like