-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaccount.java
More file actions
45 lines (34 loc) · 1.19 KB
/
account.java
File metadata and controls
45 lines (34 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import java.util.Scanner;
public class account {
private double balance;
private String ownerName;
public account(String name, double balance){
}
public void add(double amount){
}
public static void withdraw(double amount){
System.out.println("Please enter the 4-digits pass: ");
Scanner scanner = new Scanner(System.in);
int password = scanner.nextInt();
for (int i = 0; i < 2; i++) {
if (password == 1234) {
System.out.println("You enter succesfully.");
System.out.println("If you want withdraw money. Please enter 1.");
System.out.println("what do you want to do? ");
int text = scanner.nextInt();
if (text == 1)
System.out.println("your money is " + amount);
break;
} else
System.out.println("Your account has been blocked, please try again later.");
}
}
public double getBalance() {
return balance;
}
public void setOwnerName(String name){
}
public String getOwnerName(){
return ownerName;
}
}