import java.util.Scanner;
public class Bank {
private int id;
private String name;
private int time;
private int password;
private double balance;
private double interest;
public int flag=1;
public Bank()
{
id=111;
name="托儿索";
time=1;
password=95686;
balance=10000;
interest=0;
}
public void input()
{
int ids,passwords;
Scanner sc=new Scanner(System.in);
System.out.println("请输入账号:");
ids=sc.nextInt();
while(id!=ids)
{
System.out.println("账号错误,请重新输入:");
ids=sc.nextInt();
}
System.out.println("确保您身后的用户与您保持两米距离");
System.out.println("请输入密码:");
passwords=sc.nextInt();
while(password!=passwords)
{
System.out.println("密码错误,请重新输入:");
passwords=sc.nextInt();
;
}
}
public void deposit()
{
Scanner sc=new Scanner(System.in);
System.out.println(name+"先生请输入存入金额数目:");
int cash=sc.nextInt();
System.out.println(name+"先生请将现金放入出纳口");
balance+=cash;
}
public void drawmoney()
{
Scanner sc=new Scanner(System.in);
System.out.println(name+"先生请输入提取金额");
int cash=sc.nextInt();
System.out.println(name+"先生请从出纳口取走现金,小心保管");
balance-=cash;
}
public void display()
{
System.out.println(name+"先生您的余额为:"+balance);
}
public void suminterest()
{
Scanner sc=new Scanner(System.in);
double dailyinterestrate=0.01;
interest=balance*dailyinterestrate*time;
balance+=interest;
System.out.println(name+"先生输入存款时间:");
int time1=sc.nextInt();
System.out.println(name+"先生,经过"+time+"年的定期存款,您的账户余额为:");
}
}
public class main {
public static void main(String[] args) {
Bank bk=new Bank();
bk.input();
bk.deposit();
bk.display();
bk.drawmoney();
bk.display();
bk.suminterest();
bk.display();
}
}