You are on page 1of 10
“on ae fork galshalracty Gre makina bodura Coucilaress 5 “chrkynes Canir emignar = Kayrot odunyn mating kode Qendlom ve calshnl re islemtat Ze drdva, pppvmlane, iss lam ep Bap ch spombyad 0 5 bose, derlanve Ce yecumana. jotorlia bic osode bullenh | Srarflena colrasyn enpellame’ . tain bie ban Siellah ERnastii Vondeand at Jepigtents pis Keoek. 1am kallanlon vetobbr wordy. elosi femsil ebvek corn Bend obs hsb ssneler tan Qyarkl oslek tascun gyn patitixa bedehncks toatl. my, Get bards Metot ——-s*Tasikmsal resnelor Govcemiscls nesrobsin B2eLtlelarh Geprstanlock sabise nearelsia dhwmmploion Ge Mallen fle gertellates System uk. pint. Rorsola cikty ver Tip dénssin ¢ CGastrg) —> dovble Dawsens (louie ) jnt Sai, tat lot Boost 2 In tepetva be of Gst \ Fin tepe pose (ah C32)" Pita Taal aste et ee fo- ( Kexsilos bere > t Pate Koren + Bicbidyle tstersel Sleek theti sitter (clerster) Beye bo wwe, dot while, Delors —s loreak Continve , loll) cotvan | ishgne. OS peter, Polly , Free Bale ‘Teakan Gis Chkis ida slay hapah | A | Palotleta Olt bidmleri olack yr aliche - 5 Bie sian ort olka pacbel tanunlowe fore, Packet Ade sinuf Adt. = jax util sca 2 18 Yoest Keascon 3 sath Rulancoksa kerdisnck Ete. 0 sacl impet edlilve hike ic staf Kanes Ie oy pakette clap bic Impet fore. Gkl seamen. impecl jove udi, Neca saben —as next C), ilk) feline Cheostope leaks} att Next Line () pea tim (fade Bilgi Qus = Gilg Systemiin —> Uompds Gy Sarter-ovt sistem we masgile chiwie spp. ert Y releetirte_ System one 2c Bas eeeeeacgaase Sconmar been snes Scaned( Sys tenia) iPode = tome nex b Line (), fi Fe 8-92 gon Fe Abs — mollok eae Pawsxg) —syin tine buiveh SAG) se xhi9. bore BE! mractx-4y ae Ge Ginter eh ob roan (9 O-{ (@rm@sands So5' 4b Metatlor $e fe eee Tn oe up. kod bloponvn heli bo Blovi » saokt F eb Kee bbte Gap gelresife ols fovor Poremctreaia, Watob 5 Stotec @ Senda G 5 ( perlic stole reid CSteing SVaps)) poremetrest® 7 At Metod olustocobras +f badd Brainy fftetedlen Come Melodan od Meklln (pgerepelses feet a Relisleyicite Se Gerintn hpi Yio! it Portail Cnt iad Coys J Rotini = X79: False P Pe kina hoy g cetoca forfini Al ‘oe | ( public s ’ , , ) ) ) yi oe ) ) H [ i Sry ratore due PLblic Ygoilerds tae bn f Timer Co€ t Olnolicis Methed Qelooclinn — > VMetct ast file re Stak teverisincktl matter bicbtacks ay edobilvel rain tre bette Sigootye > Meteda alt motel ism ue pormeba lates 9 medoba () Meted coprseysaicter ellen Lefgtenle tle erectedor trainin: da vailan paremelreler brhei cle cypsmobde @ilardire Uatecllar: (Cons tices) —s Joplencica medot © Oleetovldep 20.8 ile agar Ho tase peanetsdé ve paranctes)t L metoblerdie Yopilorcheces medodun: Rimi toll dda vahya Bon ile yn olroliel-, Bends tip’ yobhiwBe mektler new mole eles tle. yen bir nesna Olustocs arc otovoke ohastoalote- Sf daira (= nen Yopthidirg Motley He Seyi fxs pity tT 6 Ht fie ee boule diner Crotmler ) Ht PE i 8 (kin Keeler (jae ‘den ) Tenel Goro te ae TS ‘ales Fe tad DD diet Lone int LST, - diay tS nen tal FS) Ly di begat W Owel ~ Klooedea “pirtlen Lo adeh geod fee (int xa07% < eirsey length 7 xax| f System. coh. pa atle CMTontsouy tiriab'®), fee pide = tora nectla ly -_oepetipe. t Sete Seseul fof oad bales = 3 Uygulamalar Ornek 33: Klavyeden girilen 3 sayin ortalamasin: alan bir uygulama yazinuz. Algoritmast Basla 3 say. gir Ortalamay: hesapla Ekrana yazdir Uygulamadan gik package wygulanalar; import java.ueil.Scanner; public class ortalama ¢ public staticvoidmain(stringt} args) { righ islemler icin bir scanner nesnesioluturalim Scanner tara = new Scanner(system.in); ‘ortalamalan alnacak degiskenle belideyelim DEwIREL ONIVERSITES! SULEYMAN KIM KORKARJAVR'OAN, int x,y,2/ortalama; system.out.printin(“x sayisini giriniz"); ara.nextIne(); syaten.out.printin(*y sayisini giriniz™); y = tara.nextint(); systen.out.printin(“2 sayisini giriniz"); 2 = tara.nextint()? ortalama = (xty#2)/3; syeten.out.println(“ortalama = * + ortalana} Ornek 34: Klavyeden kenarlan girilen bir diggenin cesidini belirleyen uygulama ys aun. Algoritmast: Basla Ocgenin kenarlarim gir (x.y. olsun) Kogullan belirle ise eskenar..x! ise gesitkenar..depils tkizkenar.. uygulamadan gik package uygulamala: import java-util.Seanner; public class vegen { public staticvoldmain (string (1 args){ 11 t-te ign bir scanner nesnest lusturaim, 1 nese oluturulmasi ileride ok detayltanlatacagim 1 snd sadece scanner Scanner tara = new Scanner (Systen 2); 11 Klayeden degerergirlecek dedi skenlerbeliteyelimn LUYGULAMALAR int x,y,2/uegens systen.out.printin(*x Kenarini giriniz"); x= tara.nextint(); system.out.printin(“y kenarini girints”); y = tarasnextrnt (); system.out.printla("2 kenarini giriniz") 2 = tara.nextint(); ‘1 arglastma adele olusturup dgenibelileyetin, yb yanz)( System.out.printin(*ucgenimiz Eekenar’dir* ee x=2)( system.out.printin(“uogenimiz Ceaitkenar'dir"); System.out.printin(“ucegininiz Tkizkenar'dir"); > nek 35: Klavyeden girilen vize final notuna gore bir dgrencinin dersi gecip ge¢- ‘medigini gésteren bir uygulama yazalim. Algoritmas: Basla Notlan gir Not ortalamasint hesapla (vizenin %40i,finalin 960 i gegeri) Not ortalamasim ekrana yaz Ders gecme durumunu belirle Ders gegme durumunu ekrana yaz Uygulamadan g1k Onivensitesi BiiGl MeRKEZ! SULEYMAN DEMIREL KIM KORKARJAVADAN package uygutamalar; import java.ueii.scanners public class persGecme { publicstaticvoidmain (string (1 args){ Scanner tara = new Scanner(syatem.in); Int vize , Snail double ortatana; bazskanskiklara neden olmamak kin final yerine ral allan. final deyiminin bagka hllanim alonan var system.out.printin(*vize notunu giriniz"); vize = tara.nextrnt(); System-out.println(“finall notuny giriniz"); fall = tara-nextint(); ortalane = vize0.4 + finall+0.6; Systen.out.printin(“ortelana “+ ortalana); ‘ders gegme sartanns belifyetin If (ort jane >= 50){ system.out.printin(“ogrenci dersi gecmistir”); Om germina og Ec , Grnek 36: ALPER ismini ekrana 5 kez yazduran bir uygulama yazan Algoritmas: Basla Sayag Sayag= Sayag +1 ALPER a UYGULAMALAR Sayag <5 Uygulamadan gik Sayag Mantigi Sayag bir degiskenin her tekrarda bir artirilmast ya da azaltilmas iglemidir. islem sayag son degerine ulagincaya kadar devam eder. ‘Arturma islemlerinde sayag += 1 sayagt+ +++ sayag kullaniabilinir, Eksiltme iglemlerinde sayag = sayag- I sayag-=1 sayag~ = sayag kullanlabilinir package uygulana public class sayac ( Public staticvoidmain (string (} args){ int sayac do ‘ systen.out.printin(*ALPER"); sayac +4 ) while (sayac < 5 ‘SULEYMAN DEMIREL UNIVERSITES! Bt Mit oe KIM KORKARJAVATDAN aus tuygulamada do while ddngUst le dejgkenin on degerine uagip ulasmadigint kontrol ettik Ornek 3 11den 100%, 100en 1’ kadar sayilan sira ile yazan bir uygulama yazinuz > ' > package uygulamalar; public class Abakos { Bran Gis publicstaicvoidmain (String (1 axgs)( ' AER / saya den 100 kadar yard PER for (int sayi = 1; says <=100; sayit+) Ape systen.out.printin(sayi); Aven aren 1 saylan 10 en 1 ekadar yan for (int sayi2 = 100; sayi2 >=1; sayi2. Ornek 37: 14en 100% kadar sayilarin toplammm ekrana yazdiran bir uygulama systen.out.printin(sayi2); art azain fonksiyonlannds for dongs en koaygximdr dened, package wygulanalar; a public class sayac? { > f > 4. publicstaticvoldmain (String (} arge){ ay Ornek 39: Klavyeden girilen bir sayinin faktoriyelini alan bir uygulama yazinwz, BY intsayac = 33 ae package vygulamalar; g5 int topiam = 0; a import java.ueil.seanner; ao ‘Retard toplama yopmam gereken durumlarda belli bosahmamz geek. public css Faktoriyel { 5 publicstatic oidmain (string () arge){ & anu ntopltko cancer taza = new Scanner (Systea-1a)3 a int x @ do systen.out.printin(*bir sayi giriniz"); , x = tera.nextiat(); toplan = toplan + sayac; sayactts int sayac = 1; ‘ int faktoriyel = 1; ‘akin matematisel tam geri bastante deere 1 atadk While (sayac <= 100); do System-out printia(“toplam 1-100 =" + ‘ toplem); faktoriyel = faktoriyel*eayac; > sayac = sayac + 1; > > while (sayae <= x) Bran Gis Systen.out.printin(faktoriyel); toplam 1-100 =5050 > 86 > 7 KIM KORKAR JAVKDAN, Ornek hile ve do while arasindaki farka inceleyelim. package uygulamalar; Public class whitedowhite ¢ public static void main(string| Jargs) { int x= 5; while (x < 3) ‘ xe xy ? syatem.out.printin(*x =" + x); 1/84 donate ik ce kogula bakit: Kop sadlonmanys ie déngden gi 11 Kop sablanmadigindan hts al System.out.printin(“do while dongusuna incelersek"); int y = 55 do « Petri > while (y < 3) systen.out.printin("y = * + y); 1/8 dengue tne islem gergeklesl sora kos sorgulant 17 Kogul saGlanmadisindan dngiden gl Bran Gas ‘do while dongusunu incelersk ae) UYGULAMALAR, Ornek 41: Asagidaki gibi tanmlanan fly degerleriigin hesaplayalim. fonksiyonunu klavyeden girilen x ve y X>0,¥0,¥=Dise f(xy) =2x-y-3 x<0,Y>Oisefixy) =3x + 4y +3 package uygulanalary Import Java.util.seanners public lass Fonkesyon ( public static oidmain (String{ Jargs){ eanner giris = new Scanner(system.in); Int x, int fy system.out.printin("x degerini giriniz"); x = giris.nextine(); System.out.printin("y degerini gixiniz”) y = giris.nexernt(); r6>0,y <0 se fy) = 44+ 2y 44 kop ve fonksiyonu in if(x> 0 ey < 04 fay = Aen + 27 +4 /n>0,y=01sefixy) =2x-y~3 kogul ve fonksiyanu ign f(x > 0 ee y ==0)¢ fy = dex = y= <0, > Oise fy) = 3x + 4y +3 hogul ve onks\yonu icin f(x < 0&8 y >0)4 fxy = 30x + Gy 43; > system.out.printin(“fxy = * + fay); 39 Him SGULEVMAN DEWInEL ONIVERSITES! BILGI MERKE KIM KORKARJAVRDAN Ornek 42: 100k sistemde verilen notlar: harfli sistemde gésteren bir uygulams: amu, Uygulamamuzi switch case ve ifelse ile yaparak kargilastiralim. 90 ve tizeri AA, 80-89 arasi BA, 70-79 arasi BB, 60-69 arasi CB, 50-59 arast CC, 50 nin alti FF not kriterlerimiz olsun. package uygulamalary import java.ueit.Scanner; public class maearinotul ( public static void main(String Jargs) { Scanner giris = new Scanner(System.in); int nots Systen.out.printIn(“notunuzu giriniz”); not = giris-nextint(): switch (not) { case 90: System.out-printin( AA"); break; case 80: system.out.printin(“BAY); break: case 70: system.out.printin(*BB*); break; case 60: system.out.printin(“CB*); break case 50: System.out.printin( "cc" ); break; defaults System.out.printin(“FP*); break: / site case yap le tek br deere gre islem yeplablingiginden 8089 gib aralikaryerine 85 gibi tek (7 degererkllanabiie > LUYGULAMALAR Grnek 43: 100'tik sistemde verilen notlan harfli sistemde gésteren bir uygulama ya- Uygulamamizi switch case ve if ele ile yaparak kargilastiralim. 90 ve dizeri AA, 80-89 arasi BA, 70-79 arast BB, 60-69 arasi CB, 50-59 arast CC, 50 nin alt: FF not kriterlerimiz olsun. package uygulanatar; ariNotu2 { public static void main(stringt Jarge){ Scanner giris = new scanner (system.in); int nots systen.out.printin(*notunuzy giriniz"); not = girie.nextint(); If (not >= 90 66 not <= 100) Systom.out.println(“AA"); elseif (not >= 80 && not >= 90) systen.out.printin(*BA"); elseif (not >= 70 && not >= 80) System-out.printin(“B8"); elseif (not >= 60 && not >= 70) Systen.out-printin(*cB"); elseif (not >= 50 && not >= 60) system.out.printin(*Cc"); ele system-out.printin(“PF*); .grdldig gibi else yaprinds ark tarumiayarak notumuzun har degerin daha kein belileyebiliyoruz. 1 ‘SULEYMAN DEMIREL ONIVERSITES! BiLGl MERKEZ! KIM KORKARJAVA'DAN. Omek 44: Garpim tablosunu olusturan bir uygulama yaziniz. package uygulamalars public class carpimtablosu ( public static voidmain(string {1a2g8)( for (int x= 17 x <= 10; x+#){ for (int y = 1; y < 105 y #414 system.out.printin(x + “*" + y + "=" +x! ye en; out printin(); 11g gor dngUlerne en iy enek arp tablosudur deli, Icteki donguncin her tamamlanisndan sonra dtl dong otomatik olarak artar / fades’ bic bosuk bakmakicndic Kalina tabllor i ge ger Teri sizn

You might also like