Challenge

Project 2

package main;

import java.util.Scanner;
import banks.PNB;
import banks.SBI;
import banks.ICICI;
public class costomer
{

public static void main(String args[])
{
Scanner sc=new Scanner(System.in);

System.out.println("Well come");
System.out.println("do you want to creat an account Y/N");
char ch=sc.next().charAt(0);
if(ch=='Y') {
System.out.println("what is bank name ");
System.out.println("1.SBI,2.ICICI,3.PNB");
int choice=sc.nextInt();

if(choice==1){
String sbi ="SBI";
SBI ob1=new SBI();
ob1.ac(sbi);
}
else if(choice==2) {
ICICI ob2=new ICICI();
ob2.ac();
}
else if(choice==3) {
PNB ob3=new PNB();
ob3.ac();
}
}
else {

}
}

}

package banks;

import java.util.Scanner;

import main.account;

public class SBI {
public void ac(String bank_name) {
// System.out.println("anything ");
Scanner sc=new Scanner(System.in);
System.out.println(bank_name);
account ob=new account();
ob.creat_acount();
}


}

package banks;
import main.account;

import java.util.Scanner;

public class PNB {
public void ac() {
System.out.println("anything ");
Scanner sc=new Scanner(System.in);
account ob=new account();
ob.creat_acount();
}
}

package banks;

import java.util.Scanner;

import main.account;

public class ICICI {
public void ac() {
// System.out.println("anything ");
Scanner sc=new Scanner(System.in);
account ob=new account();
ob.creat_acount();
}

}

package main;
import java.util.Scanner;

public class account {
String name;
String dob;
int account_no;
public void creat_acount()
{
Scanner sc=new Scanner(System.in);
System.out.println("what is your name");
String name =sc.nextLine();
this.name=name;

System.out.println("what is your date of birth");
Object dob =sc.next();
this.dob=(String) dob;

double account_no=Math.random();

System.out.println("what type of account you open 1.saving 2.current ");
int n =sc.nextInt();
String account_type = null;

if(n==1) {
System.out.println("**********************************");
System.out.println("acount open suscessfull");
System.out.println("name:-"+name);
System.out.println("dob:-"+dob);
System.out.println("account no:-"+account_no);
account_type="Saving";
System.out.println("acount type:-"+account_type);
//
}
else if(n==2)
{
System.out.println("**********************************");
System.out.println("acount open suscessfull");
System.out.println("name:-"+name);
System.out.println("dob:-"+dob);
System.out.println("account no:-"+account_no);
account_type="current";
System.out.println("acount type is:-"+account_type);
}
System.out.println("************************************");
System.out.println("1.intrest");
// System.out.println(account_type);
int i=sc.nextInt();
if(i==1)
{
RBI ob=new RBI();
ob.calculate_intrestFor_Saving(account_type);
}

}
}

package main;
import java.util.Scanner;

public class RBI {
String account_type;
public void calculate_intrestFor_Saving(String account_type){
this.account_type=account_type;
Scanner sc=new Scanner(System.in);

if(account_type=="Saving") {
int r=5;
System.out.println("Enter amount minimum amount is -5000");
int amount =sc.nextInt();
System.out.println("Enter time (in year) ");
int yr=sc.nextInt();
int intrest;
intrest=(int) (amount*.05*yr);
System.out.println("for saving your intrest is :-"+intrest);
}

else if(account_type=="current") {
int r=5;
System.out.println("Enter amount minimum amount is -8000");
int amount =sc.nextInt();
System.out.println("Enter time (in year) ");
int yr=sc.nextInt();
int intrest;
intrest=(int) (amount*.05*yr);
System.out.println("for saving your intrest is :-"+intrest);
}

}
}

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.