Download as pdf
Download as pdf
You are on page 1of 4
© cclinse- workspace - CAC/stc/ercjava - Eclipse IDE BBV OVE Aare Gr OFT RABEL Rear EG oro Yio ¢ Scanner scan= new Scanner(Systen. in); ntl] date; sant Jaivs Se Jaivisor; Sant Jrens ntl] eres Sine data bits, divisor bits, tot_Length; System.out.printla(‘eries aimber of data bits 5"); Gata Ditsescan-nexttot()s Getoonaw ant(date bits]; Systom.oue.printla(‘ertes data bits : "); for(int 1-0) ledate bits; is) Geta }=sean-nexttnt (5 Systen.out-printla("Erter number of bits tn divisor 5°); ivieor biteescan-nextintQ; Givicorsnew ane[ divisor BIC}; System ove. printla("Ertee Divisor bits For(ant 10; Jeavisor bits; 144) Giuleor[i]-scan.next2ntQ; System out print( ‘Dots bits are + °) forCant 10} esate bitsy 1+) AGE Longthadata bitzrdivisar bites ivena ane[tot length]; Femme int[tot length]; reoma dne[tot length] for(int i0;Sedate lengthen) Dividend (after appending 0's) are = "s diy. lengths ie) Systemout.print(aivliDs ‘System out println(); © cclinse- workspace - CAC/stc/ercjava - Eclinse IDE DY RO BV OverArie ares FAME I Mr rODerorlt § RE SSee auctions 5 Systencovt print ln(); forint 93 SediveLeveths See) 54 5 rew{] = divC3 ivide(div, divisors rem)s oc Uva Appeaton Prog Tes Js\ ae Mijares (1-Dee 220, 113568 pr 13645 pm ® 94 System.out.printIn(“CRC code i number oF data bits = . Rt Enter date bits B Enter nunber of bits in divisor = Enter oivisor bite: a Data bite are: aun ‘divisor bits are + 1010 Dividend (efter appending O'2) are + an1ti11112111000 3 rem] = eretls a) 5 romadivide(ere, divisors rem) ren Tengths 184) a Enter CRC cove of 46 bits No Error Wak 00. 4 remfcureiJa(reafeures Jratvisor(i); 5 unbe(ren[cunJo-B 22 curtanon.Lergth-2) 17 £€( (rem. ength-cur)

You might also like