Challenge

Project 2

package com.banking.details.customers;
import com.banking.details.*;
import java.util.*;
public class customers extends Account {
system.out.println("welcome to the customers");
system.out.println("you already had an account: Y/N");
Scanner sc= new scanner(system.in);
string choice = sc.nextstring();
if(choice==Y || y) {
system.out.println("which bank we want to access SBI / ICICI / PNB / RBI");
string bank= sc.nextstring();
system.out.println("what type of account you have? Savings / Current");
string accounttype = sc.nextstring();
string
if(bank==RBI || rbi ||Rbi ||ICICI || PNB || SBI) {
typeOfUser=typeOfUser;
user current= new user();
system.out.println("Insert name, type of account and date of birth (dd mm yyyy)");
sc.nextline();
current.setname(sc.nextline());
sc.nextline();
current setaccounttype(sc.nextline());
sc.nextline();
current setdob(sc.nextline());
if(current.verification()==true) {
System.out.println("your account is opened");
System.out.println("what do you want deposit / balance enquiry / withdraw ");
int f = j.getbalance();
string d = sc.nextstring();
if(d == deposit || Deposit || DEPOSIT) {
System.out.println("how much did you want to deposit");
int e = sc.nextint();
try {
int j = (addingbalance(e,f));
System.out.println("your amount is deposited");
}check(InterruptedException g){
System.out.println("your amount is not deposited! it had some errors");
}

}
else if(d == balance enquiry || Balance Enquiry || Balance enquiry) {
system.out.println("your balance is : "+j.getbalance());

}
else if(d==withdraw || Withdraw || withdrawal) {
System.out.println("how much did you need for withdrawal: ");
int g = sc.nextInt();
withdraw(f,g);
}
}


}
}


}

package com.banking.details.currentaccount;
import com.banking.details.*;
import java.math.*;
class user{
final int min = 5000;
string name;
string dob;
string account_type;
int balance;
}
public class currentaccount extends RBI{
public void interest(int p,int r,int t) {
int n=2;
int A = math.pow(p(1+(r/n)),(n * t) ));
System.out.println("final amount="+A);
System.out.println("total amount="+(A-p));
}
public stati void main(string[] args) {
user c = new user;
c.name = "c";
c.dob = "12 09 1998";
c.account_type="current";
c.balance = 8500;

user d = new user;
d.name = "d";
d.dob = "17 01 2002";
d.account_type="current";
d.balance = 12000;
}
}

package com.banking.details.savingsaccount;
import com.banking.details.*;
class users{
final int min =2000;
string name;
string dob;
string account_type;
int balance;
}
public class savingsaccount extends RBI {
public void interest(int p,int r,int t) {
int A = p(1+rt);
System.out.println("final amount="+A);
System.out.println("total amount="+(A-p));

}
public static void main(string[] args) {
user a = new user();
a.name = "a";
a.dob = "12 09 1999";
a.account_type="savings";
a.balance = 6500;

user b = new user();
b.name = "b";
b.dob = "27 05 1996";
b.account_type="savings";
b.balance = 10000;
}
}

package com.banking.details.SBI;
import com.banking.details.*;
public class SBI {
public double savingsaccount() {
return a;
}

public double getWithdrawalLimit() {
return ;
}
}


class SavingsAccount extends RBI {
private double balance;

public SavingsAccount(double balance) {
this.balance = balance;
}

@Override
public double getInterestRate() {
return ;
}

public double calculateSimpleInterest(int years) {
double rate = getInterestRate();
double principal = balance;
double amount = principal * (1 + rate * years);
double interest = amount - principal;
return interest;
}

public double calculateTotalAmount(int years) {
double rate = getInterestRate();
double principal = balance;
double amount = principal * (1 + rate * years);
return amount;
}
}


class CurrentAccount extends RBI {
private double balance;

public CurrentAccount(double balance) {
this.balance = balance;
}

@Override
public double getInterestRate() {
return ;
}

public double calculateCompoundInterest(int years) {
double rate = getInterestRate();
double principal = balance;
int n = 2;
double amount = principal * Math.pow(1 + rate/n, n*years);
double interest = amount - principal;
return interest;
}

public double calculateTotalAmount(int years) {
double rate = getInterestRate();
double principal = balance;
int n = 2;
double amount = principal * Math.pow(1 + rate/n, n*years);
return amount;
}
}
}

package com.banking.details.RBI;
import com.banking.details.*;
public class RBI {
public double savingsaccount() {
return a;
}

public double getWithdrawalLimit() {
return ;
}
}


class SavingsAccount extends RBI {
private double balance;

public SavingsAccount(double balance) {
this.balance = balance;
}

@Override
public double getInterestRate() {
return ;
}

public double calculateSimpleInterest(int years) {
double rate = getInterestRate();
double principal = balance;
double amount = principal * (1 + rate * years);
double interest = amount - principal;
return interest;
}

public double calculateTotalAmount(int years) {
double rate = getInterestRate();
double principal = balance;
double amount = principal * (1 + rate * years);
return amount;
}
}


class CurrentAccount extends RBI {
private double balance;

public CurrentAccount(double balance) {
this.balance = balance;
}

@Override
public double getInterestRate() {
return ;
}

public double calculateCompoundInterest(int years) {
double rate = getInterestRate();
double principal = balance;
int n = 2;
double amount = principal * Math.pow(1 + rate/n, n*years);
double interest = amount - principal;
return interest;
}

public double calculateTotalAmount(int years) {
double rate = getInterestRate();
double principal = balance;
int n = 2;
double amount = principal * Math.pow(1 + rate/n, n*years);
return amount;
}
}
}

package com.banking.details.PNB;
import com.banking.details.*;
public class PNB {
public double savingsaccount() {
return a;
}

public double getWithdrawalLimit() {
return ;
}
}


class SavingsAccount extends RBI {
private double balance;

public SavingsAccount(double balance) {
this.balance = balance;
}

@Override
public double getInterestRate() {
return ;
}

public double calculateSimpleInterest(int years) {
double rate = getInterestRate();
double principal = balance;
double amount = principal * (1 + rate * years);
double interest = amount - principal;
return interest;
}

public double calculateTotalAmount(int years) {
double rate = getInterestRate();
double principal = balance;
double amount = principal * (1 + rate * years);
return amount;
}
}


class CurrentAccount extends RBI {
private double balance;

public CurrentAccount(double balance) {
this.balance = balance;
}

@Override
public double getInterestRate() {
return ;
}

public double calculateCompoundInterest(int years) {
double rate = getInterestRate();
double principal = balance;
int n = 2;
double amount = principal * Math.pow(1 + rate/n, n*years);
double interest = amount - principal;
return interest;
}

public double calculateTotalAmount(int years) {
double rate = getInterestRate();
double principal = balance;
int n = 2;
double amount = principal * Math.pow(1 + rate/n, n*years);
return amount;
}
}

}

package com.banking.details.ICICI;
import com.banking.details.*;
public class ICICI {
public double savingsaccount() {
return a;
}

public double getWithdrawalLimit() {
return ;
}
}


class SavingsAccount extends RBI {
private double balance;

public SavingsAccount(double balance) {
this.balance = balance;
}

@Override
public double getInterestRate() {
return ;
}

public double calculateSimpleInterest(int years) {
double rate = getInterestRate();
double principal = balance;
double amount = principal * (1 + rate * years);
double interest = amount - principal;
return interest;
}

public double calculateTotalAmount(int years) {
double rate = getInterestRate();
double principal = balance;
double amount = principal * (1 + rate * years);
return amount;
}
}


class CurrentAccount extends RBI {
private double balance;

public CurrentAccount(double balance) {
this.balance = balance;
}

@Override
public double getInterestRate() {
return ;
}

public double calculateCompoundInterest(int years) {
double rate = getInterestRate();
double principal = balance;
int n = 2;
double amount = principal * Math.pow(1 + rate/n, n*years);
double interest = amount - principal;
return interest;
}

public double calculateTotalAmount(int years) {
double rate = getInterestRate();
double principal = balance;
int n = 2;
double amount = principal * Math.pow(1 + rate/n, n*years);
return amount;
}
}

package com.banking.details.ministatement;
import javax.swing.*;
import java.awt.*;
public class ministatement {

JButton b1, b2;
JLabel l1;
MiniStatement(String pin){
super("Mini Statement");
getContentPane();
setSize(400,600);
setLocation(20,20);

l1 = new JLabel();
add(l1);

JLabel l2 = new JLabel(""+typeOfUser);
l2.setBounds(150, 20, 100, 20);
add(l2);

JLabel l3 = new JLabel();
l3.setBounds(20, 80, 300, 20);
add(l3);

JLabel l4 = new JLabel();
l4.setBounds(20, 400, 300, 20);
add(l4);

try{
Conn c = new Conn();
ResultSet rs = c.s.executeQuery("select * from login where pin = '"+pin+"'");
while(rs.next()){
l3.setText("name: " + rs.getname());
}
}catch(Exception e){}

try{
int balance = 0;
Conn c1 = new Conn();
ResultSet rs = c1.s.executeQuery("SELECT * FROM bank where pin = '"+pin+"'");
while(rs.next()){
l1.setText(l1.getText() + "<html>"+rs.getString("date")+ "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + rs.getString("mode") + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + rs.getString("amount") + "<br><br><html>");
if(rs.getString("mode").equals("Deposit")){
balance += Integer.parseInt(rs.getString("amount"));
}else{
balance -= Integer.parseInt(rs.getString("amount"));
}
}
l4.setText("Your total Balance is Rs "+balance);
}catch(Exception e){
e.printStackTrace();
}

setLayout(null);
b1 = new JButton("Exit");
add(b1);

b1.addActionListener(this);

l1.setBounds(20, 140, 400, 200);
b1.setBounds(20, 500, 100, 25);
}
public void actionPerformed(ActionEvent ae){
this.setVisible(false);
}
}
public static viod main(string args[]) {
new ministatement();
}
}

package com.banking.details.Account;
import com.banking.details.*;
public class Account {
public int verification() {
int a = current.hashCode();
string j = current.getname();
int b = j.hashCode();
@Override
public boolean equals(Object obj) {
if (obj == null)
return false;
if (obj == this)
return true;
return this.getname() == ((Employee) obj). getname();
}
}
public int addingbalance(int e,int f) {
int balance = e + f;
return balance();

}
public int withdraw(int g, int h) {
int i = g - h;
try{
if(i>=2000) {
System.out.println("withdrawal is completed. available balance : "+i);
}
else(i<=2000){
system.println("your bank balance is not sufficient for withdraw");
}
}catch(InterruptedException g) {
g.printStackTrace();
}

}
}
}

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.