-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAssignment.java
More file actions
38 lines (32 loc) · 1.06 KB
/
Assignment.java
File metadata and controls
38 lines (32 loc) · 1.06 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
import atm.ATM;
import java.util.*;
class Assignment{
public static void main(String[] args) {
//Creating the object of ATM class
ATM atm = new ATM();
// to use the concept of pass by reference
// we have used the Found boolean array
// to check whether account is find or not
boolean[] Found = new boolean[1];
Found[0]=false;
Scanner scan = new Scanner(System.in);
int c1;
do
{
// taking the account no. as input
// and -1 to close the program
System.out.println("Enter Account number(or enter -1 to close the program)");
c1 = scan.nextInt();
if(c1!=-1)
{
// check method is called to check
// the input account no.
atm.Check(c1,Found);
if(!Found[0]) System.out.println("\nNot Found");
else
Found[0] = false;
}
}while(c1!=-1);
scan.close();
}
}