0% found this document useful (0 votes)
26 views5 pages

Bank Appcoding

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views5 pages

Bank Appcoding

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

package [Link].

model;

public class Account {

private int accNo;

private String accName;

private String accAddr;

private String accPan;

private double accBal;

public int getAccNo() {


return accNo;
}

public void setAccNo(int accNo) {


[Link] = accNo;
}

public String getAccName() {


return accName;
}

public void setAccName(String accName) {


[Link] = accName;
}

public String getAccAddr() {


return accAddr;
}

public void setAccAddr(String accAddr) {


[Link] = accAddr;
}

public String getAccPan() {


return accPan;
}

public void setAccPan(String accPan) {


[Link] = accPan;
}

public double getAccBal() {


return accBal;
}

public void setAccBal(double accBal) {


[Link] = accBal;
}

@Override
public String toString() {
return "Account [accNo=" + accNo + ", accName=" + accName + ",
accAddr=" + accAddr + ", accPan=" + accPan
+ ", accBal=" + accBal + "]";
}

package [Link];

import [Link];

import [Link];

public class BankController {

public static void main(String[] args) {

BankServiceImpl bankServiceImpl = new BankServiceImpl();

boolean b = true;
while (b) {
[Link]("Press 1 for account Creation");
[Link]("Press 2 for view Acc");
[Link]("Press 3 for withdraw money");
[Link]("Press 4 for deposit money ");
[Link]("Press 5 for update Acc");
[Link]("Press 6 for EXIT");

Scanner sc = new Scanner([Link]);


int ch = [Link]();

switch (ch) {
case 1:
[Link]();
break;
case 2:
[Link]();
break;
case 3:
[Link]();
break;
case 4:
[Link]();
break;
case 5:
[Link]();
break;
case 6:
b = false;

break;
default:
[Link]("Invalid Choice");
}

}
[Link]("Thank you for using bank services");
}

}
package [Link];

public interface Bank {

public abstract void createAcc();

void viewAcc();

void withdraw();

void deposit();

void updateAcc();
}

package [Link];

import [Link];

import [Link];

public class BankServiceImpl implements Bank {

Account acc = new Account();


Scanner sc = new Scanner([Link]);

@Override
public void createAcc() {

[Link]("Enter Your Account Number");


int userAcc = [Link]();
[Link](userAcc);

[Link]("Enter Your Name");


String userName = [Link]();
[Link](userName);

[Link]("Enter Your Address");


String userAddr = [Link]();
[Link](userAddr);

[Link]("Enter Your Pan No");


String userPan = [Link]();
[Link](userPan);

[Link]("Enter Initial Balance");


double userBal = [Link]();
[Link](userBal);

[Link]("Account Created Successfully");


}

@Override
public void viewAcc() {
[Link]("Account Details by to String method");
[Link]([Link]());
[Link]("Account Details By Getter");
[Link]([Link]());
[Link]([Link]());
[Link]([Link]());
[Link]([Link]());
[Link]([Link]());
}

@Override
public void withdraw() {
[Link]("Enter accountNo to withdraw money");
int userAcc = [Link]();

if (userAcc == [Link]()) {
[Link]("Enter Amount that you want to withdraw");
double userAmount = [Link]();
if (userAmount <= [Link]()) {
double remBal = [Link]() - userAmount;
[Link](remBal);
[Link]("Withdraw [Link] Bal is ="
+ [Link]());
} else {
[Link]("InSufficient Fund");
}
} else {
[Link]("Wrong account [Link] enter correct
account Details");
}

@Override
public void deposit() {
[Link]("Enter accountNo to Deposit money");
int userAcc = [Link]();

if (userAcc == [Link]()) {
[Link]("Enter Amount that you want to Deposit");
double userAmount = [Link]();

double creditBal = [Link]() + userAmount;


[Link](creditBal);
[Link]("Deposit [Link] Bal is =" +
[Link]());
} else

{
[Link]("Wrong account [Link] enter correct
account Details");
}

@Override
public void updateAcc() {
boolean b = true;
while (b) {
[Link]("Press 1 for update Name");
[Link]("Press 2 for update Address");
[Link]("Press 3 for update Pan NO");
[Link]("Press 4 for EXIT");
int ch = [Link]();
switch (ch) {
case 1:
[Link]("Enter name that you want to update");
String userUpdatedName = [Link]();
[Link](userUpdatedName);
[Link]("Name Updated Successfully Updated name
is =" + [Link]());
break;
case 2:
[Link]("Enter address that you want ot
update");
String userUpdatedAddr = [Link]();
[Link](userUpdatedAddr);
[Link]("Address Updated Successfully Updated
Address is =" + [Link]());
break;
case 3:
[Link]("Enter Panno that you want ot update");
String userUpdatedPan = [Link]();
[Link](userUpdatedPan);
[Link]("PanNo Updated Successfully Updated Pan
is =" + [Link]());
break;
case 4:
b = false;
break;
default:
[Link]("Invalid input");

}
}
}

You might also like