-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOnLineAccountnew.java
More file actions
49 lines (45 loc) · 1.21 KB
/
Copy pathOnLineAccountnew.java
File metadata and controls
49 lines (45 loc) · 1.21 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
46
47
48
49
public class OnLineAccountnew extends Accountnew
{
private float minimumBalance;
public OnLineAccountnew()
{
minimumBalance=500;
}
public OnLineAccountnew(String own,float bal,String pass)
{
super(own,bal,pass);
minimumBalance=500;
}
@Override
public void deposit(float dep,String pass1) {
if((password==pass1) && (dep>0))
{
System.out.println("Login Sucessful");
balance+=dep;
System.out.println("Amount "+dep +" deposited to Accountnew Number : "+accNo+"\n");
}
else
System.out.println("Check if values are negative or Verify password\n");
}
@Override
public void withdrawal(float wdraw,String pass2) {
if((balance-wdraw>minimumBalance) && (password==pass2))
{
System.out.println("Login Sucessful");
balance-=wdraw;
System.out.println("Amount "+wdraw +" withdrawn from Accountnew Number : "+accNo+"\n");
}
else
{
balance-=25;
System.out.println("Check your balance or Password\n");
}
}
public String toString()
{
String disp="";
if(balance<minimumBalance)
disp="Accountnew Number : "+accNo+ " - $25 fee has been already been subtracted needs to alert the customer.\n";
return disp;
}
}