You are on page 1of 11
ee Home Dasign ment! gust the Beywords, if Java fey wordt + abstroet, assert class, corst, dival, finally, fastanceot, int, private, pr Sheetfp, Super, Sur! h throws, transient, *t, boolean, break, byte, Case, clefautt, alo, clouble, ele, enum, extend, tloat, interface, long, native, New pockage, otected, pubh'c, return, Short, Static, teh, Synchronited, thit, throw, dlta types, Site anal ranger in Jova, catch, char, for, go to,''¢, implementt, import, tiy ; voicl volatile, while | data type Site ‘Yange | bute 1 byte Short 2 bytes -30768 to 3at6F | byter (8 by er "| [eat 3 to ae | rlag to a7 | 1 | 134 [DFT 4 Se Ba-bit 1EEE ste Hoa eg) ble preion: double date | bate uci et ee | | book Ba rae are 1 bet L true or false (efor |2balelonks 0 fp 65088 he Create a closs Student with Static ana bler Tram, td gender, dept , ™mobile , three Mubleet mari ard a Stabe amethed aitploy Details > to dlispby name, Cast five obigit of your TO lumber, genoler. dlepartment , Mobile and percen tage of Marks, Reaol all the tp inputs ting Cornmancl bine Arguine, nk , acces the olttplay Detar © from main () Luithin the same Class A) Code: Package har: Public closs Student < Static Sting name, gender, cle pt : Static Cong td, mobile: Static Shot $1,283) State, void cheplayDetailrc y System. out. println ("nlome:""+noenes System-vut. printhy (s Toh "4 td *l100000): Suctem-out-printhy (“Gendacy se eniler Sustem -out-priatle ("Department s+ ae Sustem-out piintln (* Mobile s"'s-mobile): Sastem. outs print (* Percentog ey "2 Corasees) y 73)), Public atic YI Main (Shing C1 e195) ¥ aname = avgs{o} s Gender = args(id: dept = args | _ ite tol = Long, povselong (orgs): amobile = Long. partelorg (v9! fay): $i Shorts ParseLong (avgsr): 82+ Short: partelong (avgsf222 83> Shots porte Long (argsl#3): dhiolroel dbyplyDeto'tl y . Input fn Argument Thon 1 Mote CsA Dopo 3U3!4 QHOSUSP2AD Bor BG AD 9 Output: Nome Shon Bdy 32314 Gender: Male Depostrnent 8 Mobile: WOTUCWAA Pescantoge : 23 A) Given an tateger , 1, Perloim the Allowing Conch tpn al achons; Tt nts Odd, print Weird, TH nis evenand inthe Mmelusive vange of A4DS, print Not Weird . TH nit even Gnd in the Mmelusive range pt 640.a0 sprint Weird . TE nite Coen and greater than 80, Pint Mot weird. Complete the Stub Code "rn Your editor to print Wwhellar Or mot iy eoeere , closs cbagram: Weitd Not eit pockegt hats fenport Jaa. utile +5 ‘publ nlare Werd-Not v Pubic id: rain (Shiegl) args’) { System,out; print (" Scarmer SON* Te Sconner (System: anys, gat 1 = San. aneat THtS San. closeW5 2p Cree bed) x Suttems ius wrinkle, dtahe Uo Enter a numbers") 5 (wweted” Dy else if (anebr 220. ab Pea Ra neers) E System. out: pei atln ef ebseit (9 . A Sygtern. out (not Wet) enpeso && nr26 BBR 6280 ) printls (“weird mute BR M> 20) s Oise i (mehr, a t System cout: pantle {" Alot \ ‘ torird mis y y Dopey 22 Dutra: woe Not uel >. 4, Create a class Ublety watth three Stabe metho, | Sot b> whieh ateept an anay of integers “to Sort Atom, find Simatiest O) which Alcepk an Artay of integers to find Smallest ualue, ind Largest) twhich accept ay away of integers 40 find largest 4 there methods fom main L) of Heren? pac loge (Foxe rnput Ualue. Accet. Demo clan of ar Airough Connmanso LiRé!): * Cole: Package har; frnport Jaua. wk Arnaut; Public Clas Uhbity ¢ Pubic Sake iat () Sort Lint af) Avrays. Sorta) 5 tetum a, y Pubic Shake int fndlargert (int a7) x int Mar=afo): for lint P20 3 tealength i++) Q if (00:) s mar) x Marsa (ry: y Teton max, public glalte tat ted Smallest (jet ot1) dink mins 007, fos (int 120 5 £2 aslengths P44) Rott (atri4 rm) Lo mine al?ls hat 7 | 5 ‘ | teluin Onin ¥ J. Fe anolier Package: Package prs \rport hal URS pub. Clas Deeno ¢ Public stale oid -mnain[Sting 09 | =new int flargs. length: ite orgy. lengths X fpt af dor (int 0 «ate cpteger, pate tnt (avgs(e7): y Ufility Sort (a), j System cout « printer Moved sArmy ” ys ttt) oN fox (fat feo; (ca-lengths 44) a fyitem. oud. print (afr)4" ")s y Suthemout prinths [ 1 \n largest elements” 4 Unity. findlargert Cary Suter .out print te ["Jmatiert element vh Lt hy, rod Sona Iles tla) 5 ' Command hine Inout s 85 ao lo teth Fe -lol Oubut: ate, Sortect array LipE) ae ulO,. 20. Tb Td 4 (airgest cloment + 18 ee : Smoller cloment .-IDID snail lacy ie} pot fod laigert a Hod Sroltert 5. Create o Cull’ clase ieatth'3 public. frgtanes vonabley fengtts; Greadth, and height oF type clouble,and a emethod volumety. Create & object ev'ry abHerent | obtained »by Command fine, argument and pric’ program Must take 6 wvaleees the Volume of, Cah. (The alust of input). a Class diagram: ole ! 1Gn0 © Package har; \ Public Clots Cuboid x Public dlouble Gbrhy Static Double Nolume (DodbleL, Double b, Rouble A) < yelum Jtbhs Diemer, Pubic Satie Void mato (Shingl) ara1) < Caboid objrs neve Cuboield; Cubsid obj? = NEw Cuboid O35 phfs f= Double paveKou ble (args(o1); Obj b ~ Double parse Double (orgslo1)s Obi, h = AOUbe, parseDouble (args[es), Obj2.1 = Dowble» porse Double (2795(31) 5 objr.b'= Doubles parse Double args); bb} sh'= Double parse Double (orsufea), Suen out: printen te Uolume ¥ 4 plume 065104, Obs by Obs hy) System out printle (‘"Wolume: 8, Uphime (phii£ 0 bi2-b, aie ol 6. The Fibonacci numbers, Commonly denoted ECnit rom a Sequente, Colled the Frbonacet eqteenco, duch that each number is the Sum of the ’ do prececlivg Orel, Starting fiom Oands, rlo)s0) FUI2 1 Flos Pn) elm) | That i dor not Given % Gleulote Flr). Aloww ayour task to print the Fibonacier fever neamber upto n mum ber A) class cliagram: oid code: Pockage havy import Java tl 3 Public clos Cibo ¢ Public flare uoid rain (Shing Joras) ¢ aut fiso det 435 System. cut: print Ci Enter a number i")s Sonnet Scone New Stonrer (System-in): int 7 deannexE Intl, Stan. closely; for [int 120 sven site) d System. out print (4; das ditty fishes fr 23; y

You might also like