Untitled

 avatar
unknown
plain_text
5 days ago
1.7 kB
4
Indexable
import java.util.Scanner;

interface payment{
     void withdraw(double amount);
}
class credins implements payment{
    double gjendja;
    public credins(double a)
    {
        this.gjendja=a;
    }
   public void withdraw(double amount)
    {
        if((gjendja-amount)<500)
          System.out.println("Terheqja nuk u krye ne Credins! ");
         
          else{
              gjendja = gjendja-amount;
          }
          System.out.println("Balanca aktuale eshte "+gjendja+" LEKE");
    }
}

class bkt implements payment{
    double gjendja;
    public bkt(double a)
    {
        this.gjendja=a;
    }
  public void withdraw(double amount)
    {
        if((gjendja-amount-0.015*amount)<0)
          System.out.println("Terheqja nuk u krye ne BKT! ");
          else{
              gjendja = (gjendja-amount)-0.015*amount;
          }
          System.out.println("Balanca aktuale eshte "+gjendja+" LEKE");
    }
}

class otp implements payment{
    double gjendja;
    public otp(double a)
    {
        this.gjendja=a;
    }
    public void withdraw(double amount)
    {
        if((gjendja-amount)<0)
          System.out.println("Terheqja nuk u krye ne OTP! ");
          else{
              gjendja = gjendja-amount;
          }
          System.out.println("Balanca aktuale eshte "+gjendja+" LEKE");
    }
}

public class Main {
    public static void main(String[] args) {
    Scanner input=new Scanner(System.in);
    System.out.println("Shtyp 1 nese je klient i Credins Bank");
     System.out.println("Shtyp 2 nese je klient i BKT");
      System.out.println("Shtyp 3 nese je klient i OTP");
      int nrbanke=input.nextInt();
      
    }
}
Editor is loading...
Leave a Comment