0% found this document useful (0 votes)
50 views69 pages

Class X Computer Application Sample Practical File

The document contains a series of programming tasks and exercises, primarily focused on number manipulation, string processing, and basic algorithm implementation in Java. It includes instructions for checking properties of numbers, such as finding the greatest common divisor, identifying special numbers, and counting digit frequencies. Additionally, there are tasks related to string handling, such as finding the shortest and longest words in a sentence.

Uploaded by

tanmayjain34565
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
50 views69 pages

Class X Computer Application Sample Practical File

The document contains a series of programming tasks and exercises, primarily focused on number manipulation, string processing, and basic algorithm implementation in Java. It includes instructions for checking properties of numbers, such as finding the greatest common divisor, identifying special numbers, and counting digit frequencies. Additionally, there are tasks related to string handling, such as finding the shortest and longest words in a sentence.

Uploaded by

tanmayjain34565
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
[PAGE No. | ] er | SERIAL w| Toric. PRE NO | 116 chock sohother a number ig Narshad number oe nok ee 2 110 input tow noe ard find the Gralst Crmine Divisor | 3 To check wAslen a, sd it bmi der wont 4-5 2 4: fo chk whether q monber j 2 hov-ligit special number vcast 6 + 5. To cont and chock freqpong of cathe digit present” in nde} @=F 6 | T6 cam ane prin” frequency sf tate alphabok” preseot ine Stig 0-i] HM find He shortest be lingual” mcd ine a sentence, Tnety %: to merge ara display thee slemowte ob won oxtoys IS-lo Af dere a ptr emt waing. Bing Ceoarch, Bebiing B- 1e L0- To adler a senbleree anal prin? words jn reverse. order |9- 20 We To chek, whether a number io Evil number or not 24-23 [ete fo token a. 01d inpu aucd eocade, ike inf Pig lab. 04725 {10 accept 2 ivi clenants and ottarqe thaws Me actnding 6° Gu bang Bubble Smt Heduniqne. 1a To accept nainee anal. income: of employee. aul fine ees fe wing function To (Sting name, Mt income) ' 15- 110 final ale. of parallel grap, rhambuy, Mapesiun: being 0-32 —| matted overloading, 6 | hunclhion overload 40 digptay os foUlau = 33°38 |= Speriod uo or wots ved display (§iving, she, char chy) £ = Shing Aquat ved digplay Cling shel, Shing sh = | — Rint len at position void tigphay (Shing. she, in [paceNo.[ | DATE] EXP __| twin Prime ve hol: L - Topic fAGE NO \#__/f6 take. twlegng inpul and dock whaler thoy ave | 36-3 an Boy a’ brongle ona folowing paler | 18. [Suche atetead™ rile a mn dive program bo JBE- YO toe =) 1c 3s 1CSE 19: charges are [ioe se posronsort based on distal AI-kE Os fer tre. tarili: Design a pragrai hy inp aa ea lea A a aa paid - | 20 Opi cme of 40Vi2s — Pre 493 0. 4d 43-44 oy 3) nl a -- a —— x. | ———— — _ / T _ _ c [ a _ [Pace No.[ 1 DATE, ee] [isa pagc ep aa nne ak it ino. Hanshad Number ov not: oe _ [cali : ; = lll “Hes _ — . i a =<) Pe eel ote (String ange LD Sconmr ge = how Sonne (Sghen w): _ | Speteonouk print (“Eatin a number’) a - et w= se-nonh bl); M faking nasber. a ser ind copy =, d, cum =O; gue C270) Icomdtion checking for loop d= wh to; Nlestracting ast digit of He number > Sturn = Sun td; I hincivg sume of digiP of the punmbor Az hhlo: J NATIONAL == 0 M checking i Sane ate sham keprivtn ("St ns i ofits inti not a Harstad Number’); —— [Foe — PAGENO| 2 | DATE| EXP To take number input Pld uaer : punnber To extract the digits fp uber To find sume of digits oP member a> _ a NATIONAL - _ n 4 7 _ Enter a number 18 It is a Harshad Number [PacENO.| B |Dare| | L Write o Program in Sova to impud ZL rumbors owl pind Hun Greatest _Gmmow Diviser (CD): [Sid ineport joc: vil Scawaad j - public. oss GOD li — =) | ble shbi vid maine (Sbring comps) Mraine meld 2 & bal, p System: - oud privtlre paunb, | ink_re[ ase rank Trt); Waking. ist re | int dreds se net Tat); IHabiing seroma wo: input while (nr J2 0) Merrdition checking for loop | £ ink ts 2 ween nrj Mpnding remainder after. diving 1 by n> _ mse NATIONAL — Sasteme ok pitt (GD = “+ D3 » | Jt Cc. | Variable ‘Deseviplion Table. 4 lu ¥ pose. [etna in B take hoo wos inp from user Le To since copy nf seird srnley ENTER THE FIRST NUMBER | 24 ENTER THE SECOND NUMBER 42 GCD=6 [PAGENO.| 4 at] 3 (nike a pug in Tete bing a mubsbon. aural. chow wahethan it - is_auns Auto morphic. Mumbor or pot | import java util- Scarnor; - public. clans Aubirsorphie, 7 if —_ 7 9 a Shalt void maine (Shing ongsC3) Aran 90 = hw Starwwv (System: in); _ _ souk. prirctine CY Eton a number’); ind w= Senet Gat UO; lM tahing tussbor input” frome wor int copys bh, o=0: - double 24 ; 99.2 h*n: I fiwcling the om HO mumbo while(n20)_|I condition checking for loop _ _ => i a ee ec tl) Mounting pumnber of digits of- tthe number hn 10; EEE — NATIONAL); J nde i) gt joo, oD; Ventisctng fae last ditt — Of the square of Me number, | sf fd cempy) Wetacking 1 if leat digits of square is the equal to [Med tee original mumbor - po — Spsenc oP print (Ht is ae Adega. Nandan’) — _ pee ee nr [raceno.| 5 | ae eS a _ Variable, Descriptine Table _— Data hey ie To take, number ingul fms user py wt {16 make. copy of number : cg, | dmble — |16 Store nuumber _—_ tet DO fine count of digit Ld | tnt te evtract te last digits of Square BO NATIONAL), _ po — OS c. a Enter a Number: 125 |25 is an Automorphic Number 5 = exZ PAGENO.| > | [ep —| [AL Speiad. tame digit rumba in anc Hat whew “the sume of | Mew yi fo addled tp the product of ik digits, the nowlt is equal tp he original two digit number’ Write ov a prognam to arupt a tun digit number Add the Sum of ute digit +o thu product of its digits dP he vole ie eqol Lt Hoo mumeber input _ ov oud the meseage. “Serio two- iit mode, _ otherwise, odjul the mtesage “Net a Special two-digit pusher Shion: import jawa.: subil Season: i - -_ _ —_— Gasiod il Lie aba wid_ sine CString ange £3) L Scammer So 2 hows Sasa [Syste - int ne ceeta I daking nando inp how wer: | nd 28, prot |, Suse Oe Sets a while n2 0) Il pe: § ot ee Mente igi Peon _— | Zttd; Mpnding sume of digit of suntber” pre = prod II finding aa Aa af melon ee ne Wtio, — | —__ Btu ums js Adding Sum and pad of Agi of rnlow o_o if sum == copy) Mebecking if sume ig epuod to eriginal mehr (PaceNo.| oare| eet] Variable Descnphion Table Gatemoudiprintio (Seal hoo digit number"); ae _ —— nome [Date tpel Pepe —) nw iwh To take. input _ 3 Tt 10 find ee rp deg p_|ink | finol product of digf Leepy | int . oP pumber Sum | irk (To finel sume nf digil and _prduct of- digits d |i To exbiack the. digits of number _ | > a WOM, 10 a T LL c. re Enter a Two Digit Number: (234 Not a Two-Digit Number ‘ dy Enter a Two Digit Number: 59 Special Two-Digit Number 1 ‘ W \ 44 wo" WC | \ i 4K \ Yan = S NATIONAL 4 c. | Miike a progtame tp topic a number Count and pid fhe fe [PaceNo.| DArE| EXP Lo a2ck digit preset” tre tat mumaber Te salt tal be given mn input” - 445; - lic stati. void main: (Sring angs(3) — Gyhlm- oP print. (“Ember a musmber”)y . tt cE 90 nok ToC) tht FL = new int [10]; Marray +o bold count of digits | for nk iz, 14.10, i+) Mor loop: ~F NATIONAL H. T c. [PAGE NO. | 4° are] EXP | (hile (70) ae 10; Uedbiacking digit Of humaber a bth 9 Mirmaalg- ct ofa a nenio; _ | — Spleaneud pi Wee eee”) Systen-ouPprinkte- ("Digit \e “rene Stes epic Cannncess'} for link is 0; 1X 10; itt) Mfor lop i if (pl20) Segal: ubeprndlne (fF pO) Purpose To take warber ynpul WO | AYCoy Ap held com Of digits Enter a number: 345236431 Digit Frequency J 1 2 1 3 3 a 2 5 1 6 1 —? PAGENO | 10 are! ex | ~ lle a progtanm to tral Q@ shringy luo0td.)- Conmert jt indo louseriose tellers ~ Count curd print the fre Op cache alpbabel presed ue tha. Shing: Re ould’ should Stn Lanplen input - Mpha hele ___ — 7 Sample odpul” = Alphalee ~~ pe I- ingoct jm ul x pe awe his Foun _ fic se void. mare (Shing, args l)) Seamwer se 2r00) Scarner-(byleocin) oe Syston ob: prinktne C'Enber. String"); - _ String 9-2 8c-haufline (); Mtaking. Shing impit _ $2 9-4olowerGse (); Meonwerting ching into lover case | Le 9 lengli. () Mfineling Leng Ho of abiing |Site 2a nen [pace no.| | a yo (IRL: 2 s2-s2-2") ve L int c= 0; fe (char ie a’ ; igs Sepia) losker fer loop 020; for link jo0; jXUj p+) Minner for loop ib ch «8: charht )enbracking charade of thing if (de==?) ett; Hincremooking cot if €c I= 0) F Spleen cub: privttin Cit"lt’ +e): NATIONAL), Veviable_‘Deseriph Table H. T c. Ewhackng heracey xf String eee ere » \ , \ \ ag q aa\ Ve gon ¥ & %. 1) ¥ z= Ey iS eax | ne (“Enter a string’); [PAGE NO.| 1+ pate] exp | . (Orie @ program td fine Hoe Shovlot and longest voord in a ul Laval print Bone along with their lent: Larple Inpit = 4 am learning Sone Sanple. bpd - Gevlest word =L tengo =l_ _ Longest word = learning lengtte oe lmportt java-viL:*; pi Clas Froxrom/ jie chakic void rain, Citing args 3) 7 Garver. S02 hour Scanner. (fyslinaiine); Shring othe fo tring S cnet Line U); Mtebing Senteuce input Sieg a1 = new String [8-lengtt. (1; _ =" char cs oo : a _ tne Ae Oi a peti 2.0; 1X8-lengiful i++) U for loop: [oo ce =[Link] (i) ; ULExtacking cbarackers shing eed (ele) W checking ile charaktr ia a black space [pace no] /3- | e— — Me _ L L av (kJ = atl Atty _ SHle*" f : - 3 ti = - - String | mine“ ” _ [ for liso jixkzit+) [Ifor loo, - if bavliJ-lengit() > mart leno ()) mare= [i]; Massigning mar unthe to- longa word a : hdres mar 5 (i20; iRk i++) me - if (arGi} legle VK maine abet) —— NATIONAL | S$ _ © Pyles eu8prindtne Longest aid \E mane +E at engi It tna: length!) fate mint Stet word I mint AS lenge WO b tt mine aoe Ke PAGE NO | Variable. Deseription- Table. - | _s_| String Do take string input a av Shing To Make a array por Shing charackg Le | cher | enbrack characke of String i we |B Cunher variable of loop | stl | Sting | 16 shore the string k | ie TO shore count Tp charackers moar| String | To shore longest word - ; hai | String | To Store shovéeat word +1 NATIONAL H. = — T Cc. = _ Enter a String: | am learning Java. |Shortest word=I |Length=1 Longest word=learning ‘Length=8 \ A hy 4 \ 4 1s 1 te \e Be Pow Ww Viv af \ wh ha QL wD NATIONAL | H. T c. [Pace No.| 19 pate| EXP | [Oreo pragraine 40 Create: hoo Arraxp ACD avd BIT having siyee Lone curl nw verpectivély crete a third arroy CCI ushich. will merge arreg ALI and BL] trgelher omol store. the it anal pried C61: | Dlutioné oo import jawa-whil- Scanners oe |public. Class Merge _ g _ _ _ | public stabi, void. raain Catrina, argal) L Stammar- 8c = new Sanne growin)! ee | Syphemsoub-prinb “Enker Sige of- Array A”): th me = 9t -neA Tab () _ 5 povtti. U'Enke rr size Of Rrrog B'); ind nz 8e- wert Tt; — | it ALT= newint [mJ]; ind Helbig ayy he BID = newink (J) int CCD how nt Crtn); | Sypheae oud pvt (MEntet cheno of Rive 8”): doe e105 1 hw) +) ho | Ali = Sc- nef IPC); Wferking 2lemute inpu © Saslenn io printlne (*Enktr Clements of Arron 8); - | for link ia 0; 1X re 5 i++) Moe loop BRT = Sc nenb Trt(); 5 : for Gnk f= 0; y. I Lionile = | Piegfen safanitaleearch a_porticulay Remst or orf oy wing [en Beane Tecate — a |——— a ee a = piblic._clons Genre aad i Ler Ved mai imp ogsld) Wl iijy bw f2 O; & cS " Seannwr, * | Syslera cubs printf. (“ Eley yee Of Oe ores) [th 82 cena EU — | tnt_A 3 new | tnt CsI; linitiods Uinitiaki sing, am Spb pi kr og Matt ay ae _ Us0,; iX8; itt) se | CD = ce-nent PU; 7 slo ouk-privktin Enter number to geaven' IE UP p= ce newt Trt), NATIONAL | L2 0; Ulower limit, uz s-ly Wupper Riwi > , LL while CA cc: nowt TEU; if 37 0) Mehecking if rau is paitive: 1 Bhing Une = cstoBoarg UA; I walhod call sol. inthe (inary opuvalent = thin} tet ue ob: cowl the Un); Mmethod all : | Fp bint le os ‘Ry __tf (xt =-0) ——— — Sigshonc oud prinkine ("Evil Mamber); cbse __ a —_—- Spsleen:pirdlne U' Wot” an Evil Mambe } he OO _ PAGENO.| LD) DATE! | EXP Spltor 08 pire [Terabid nga") Name. | Daka futpore. i | Sormal patameltr i the bamber ‘inpct | To sbye chavaders - 0! to o_dore. hinar4 vf. anbeced wumbey to Ped tare af lin Taam wanaber bg 2 To shore, Cound” TE find lenge vb = | To eubrad” chavacker of digit 4 Counter variable. of loop ee tnt | 10 take umber input? from wer a ‘ 0 store binary opeimalact veburned ig mato’ — __ to Store. cavt yehurned byt mttiod _ a Enter a Positive Number : 15 Binary Equivalent = 1111 Number of Ones = 4 15 is an Evil Number. | PAGENO.[ 24) Datel a E : L import jave-whil: Canaonrs public lass Programe public State void main lsing og D) £ Scamor sc. = how Starve Choshin); - Sepllon ube prinbl. O" Erker a. word"), — | String 6 = 9c: nentlino Oj 82 9 Upper Cae, Meowerting he. woid YparCase — NATIONAL ee HzO, iXs-lenglO); i+) Mfor lomp ~ T. — _ oe - —— Sl char ch = 5. cher Ae Gi); Mectracting choractesof “rd, if Coz 2A chez EM chose" ch 2'0 Meh =*U rerk Il come. mb of the loo he vel is pe te ER pe | Shing Foe.a Lohing UD + #.sabing, (05.24 "R15 __ NATIONAL PAZ (race wo | 25 DATE, exe | Aig eon oud pritlr b), f Nome | Dak “Wp eve |g Shing | 16 take word input from wer 4 we Counley variable che _|_chay To _vekack charaders of. word |_f Siva, te Shre. fig lak. of word: Enter a Word: COMPUTER OMPUTERCAY | Import ja ywarubil: *; PAGENO | Db are cal le ac pogiame ame accept a tist Of- 20 infegers- Sect al Ha ete th tending order by using Bubble Gort He Pniayc _ public chess Pabble Set a — jublic_shatic vid main UBting args 3) Sannont ce 2 news Garson Open in); nm tt yl = pow int boo), Uisihalizing eg HEP os | 4m ibis 205 1< (22 as +D Mor loop fav no sf. erat — Got j20;: ik < (20-11) Gj lor ong. roo compose t AG)? A ca) NATIONAL a | rE _ we temp af cy) } Ms Roagping values — ACjl= AG + 11, LL AGri) = Herp; as _ for Gr 120, 1<20, 144) Ilfor low _

You might also like