NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

package ATMOrnek;

import java.util.Scanner;


public class Test {

public static Scanner sc = new Scanner(System.in);
public static void main(String[] args)
{
Kullanici k1 = new Kullanici();
Kullanici k2 = new Kullanici();
Kullanici k3 = new Kullanici();

k1.sifre = 1234; k1.bakiye = 2000;
k2.sifre = 3456; k2.bakiye = 2500;
k3.sifre = 4567; k3.bakiye = 1500;

ATM atm = new ATM();
atm.kullanicilar[0] = k1;
atm.kullanicilar[1] = k2;
atm.kullanicilar[2] = k3;



System.out.print("Şifreniz : ");
int sfr = sc.nextInt();
atm.enter(sfr);
System.out.println(" ");

while(atm.islem)
{
System.out.println("== Hoşgeldiniz ==");
System.out.println("Yapmak istediğiniz işlem türünü seçiniz.");
System.out.println("1- Bakiye Göster");
System.out.println("2- Para Çek");
System.out.println("3- Para Yatır");
System.out.println("4- Çıkış");
System.out.print("Seçiminiz : ");

int sec = sc.nextInt();
if (sec == 1)
{
System.out.println(" ");
atm.bakiyeGoster();
}
if (sec == 2)
{
System.out.println(" ");
System.out.print("Para Miktarını Giriniz : ");
atm.paraCek(sc.nextInt());
System.out.println(" ");
}
if (sec == 4)
{
atm.islem = false;
}
System.out.println(" ");

}
System.out.println("İyi Günler Dileriz.");


}
}










package ATMOrnek;


public class Kullanici

{
public int sifre ;
public int bakiye ;

}









package ATMOrnek;


public class ATM {

int kBakiye = 0;
Kullanici k;
Kullanici[] kullanicilar = new Kullanici[3];
boolean islem = false;

public ATM()
{
this.k = k;
}

public void enter(int sifre)
{
for (int i = 0; i < kullanicilar.length; i++)
{

if(kullanicilar[i].sifre == sifre)
{
kBakiye = kullanicilar[i].bakiye;
islem = true;
break;
}
}
if(islem == false)
{
System.out.println("Hatalı Şifre !");
}
}

public void bakiyeGoster()
{
System.out.println("Bakiyenizde : " +kBakiye+ " Türk lirası bulunmaktadır");
}

public void paraCek(int miktar)
{
if ( miktar < kBakiye )
{
kBakiye -= miktar;
System.out.println("İşleminiz tamamlandı. Hesabınızdan "+miktar+" Türk Lirası çekildi.");
System.out.println("Hesabınızdaki günce para tutarı : "+kBakiye);
}
else
{
System.out.println("Girdiğiniz Tutarda İşlem Yapılamamaktadır. ");
System.out.println("Menüye yönlendiriliyorsunuz ... ");
}

}

public void paraYatir(int miktar)
{
kBakiye += miktar;
System.out.println("İşleminiz tamamlandı. Hesabınızdan "+miktar+" Türk Lirası çekildi.");
System.out.println("Hesabınızdaki günce para tutarı : "+kBakiye+" Türk Lirası");
}

public void quit()
{
islem = false;
}

}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.