Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Team Neoteric_SY_40 #21

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions AskAccount.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package Project;

import java.util.Scanner;

public class AskAccount {

public static void whichacc() {
@SuppressWarnings("resource")
Scanner sc = new Scanner(System.in);
if(Project.Login.ll.size()!=1) {
System.out.println("**Select Account**");
for(int i=0;i<Project.Login.ll.size();i++) {
System.out.println((i+1)+") Acc "+(i+1));
}
int n=sc.nextInt();

System.out.println("Using Account "+n);

}
}

}
187 changes: 187 additions & 0 deletions Feature.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
package Project;

import java.util.ArrayList;
import java.util.Scanner;
import java.util.Stack;

public class Feature {
static Scanner sc = new Scanner(System.in);


static void checkBal(Stack<Double> bal, double d,int a) {
System.out.println("*Check balance*");
System.out.println(bal.peek());
d=(double) bal.peek();

}
static void fundTrans(Stack<Double> history,double d,int a, Stack<Double> bal) {
System.out.println("*Fund Transfer*");
System.out.println("1. Withdraw");
System.out.println("2. Deposit");
System.out.println("Enter your choice :");
int ch3 = sc.nextInt();
switch(ch3)
{
case 1:
System.out.println("*Withdraw*");
System.out.println("Enter the amount");
double w = sc.nextInt();
history.add(-w);
if(w<d)
{
d=d-w;
bal.push(d);
// System.out.println("New Balance : " + InitialBalance);
}
else
{
System.out.println("Insuffient Balance\n Money cannot be withdrawn");
}
break;

case 2:
System.out.println("*Deposit*");
System.out.println("Enter the amount");
double de = sc.nextInt();
history.add(+de);
d=d+de;
bal.push(d);
// System.out.println("New Balance : " + InitialBalance);
break;

}
}
static void transHistory(Stack<Double> history, @SuppressWarnings("rawtypes") ArrayList<Stack> History, int a) {
System.out.println("*Transaction History*");
for(int i=0;i<=History.size();i++) {
if(i==a) {
History.add(history);
}
}
Project.Login.display(history);

}
static void Loan(Stack<Double> bal) {
System.out.println("Loan");
//System.out.println("Enter account number");
AskAccount.whichacc();
System.out.println("Enter the Loan Amount : ");
int loanamt= sc.nextInt();
double min=0.3*bal.peek();
if(loanamt>min||loanamt<bal.peek())
{
System.out.println("You are Eligible for the Loan.");
System.out.println("Now Submit your documents (True/False)");
boolean doc = sc.nextBoolean();
if(doc==true)
{
System.out.println("Your loan is granted.\nThe amount will be added to your account");
bal.push(loanamt+bal.peek());
}
else
{
System.out.println("Submit your documents");
}
}
else
{
System.out.println("You are not Eligible for the Loan.");
}
}
@SuppressWarnings("unchecked")
static void BankDetails() {
System.out.println("");
for(int in=0;in<Project.Login.ll.size();in++){
System.out.println("Account "+(in+1));
String crn = (String) Project.Login.ll.get(in).peek();
Project.Login.ll.get(in).pop();
String Acc = (String) Project.Login.ll.get(in).peek();
Project.Login.ll.get(in).pop();
String ifsc = (String) Project.Login.ll.get(in).peek();
Project.Login.ll.get(in).pop();
String Bankname = (String) Project.Login.ll.get(in).peek();
System.out.println("Bank Name : "+Bankname);
Project.Login.ll.get(in).push(Bankname);
System.out.println("IFSC code : "+ifsc);
Project.Login.ll.get(in).push(ifsc);
System.out.println("Account no: "+Acc);
Project.Login.ll.get(in).push(Acc);
System.out.println("CRN no : "+crn);
Project.Login.ll.get(in).push(crn);
}

}
static void changeAcc (int Mpin) {
System.out.println("**Account Change to**");
int chg = sc.nextInt();
for(int in=0;in<=Project.Login.ll.size();in++) {
if(in==(chg-1)){
Project.Login.ll.get(chg-1);
System.out.print("Using Account "+chg);
main(chg,Mpin);
}
}
}

public static void main(int n,int Mpin) {
@SuppressWarnings("resource")
Scanner sc = new Scanner(System.in);
int a= n-1;
double[] Balance = new double[Project.Login.ll.size()];
Balance = new double[]{5000,2000,1000,3000};
Stack<Double> bal = new Stack<Double>();
Stack<Double> history = new Stack<Double>();
@SuppressWarnings("rawtypes")
ArrayList <Stack> History = new ArrayList<Stack>();
bal.add((double) Balance[a]);
int cho;
do
{
System.out.println("\n**Home Page**");
System.out.println("1.Check balance");
System.out.println("2.Fund Transfer");
System.out.println("3.Transaction History");
System.out.println("4.Loan\n5.Check Bank details");
System.out.println("6.Switch Account");
System.out.println("0.Exit\n");
System.out.println("Enter your Choice");
cho=sc.nextInt();
switch(cho){
case 0:
System.out.println("Thank you");
System.exit(0);
break;
case 1:
checkBal(bal, bal.peek(), a);
break;
case 2:
System.out.println("Enter your MPIN");
int mpin = sc.nextInt();
if(mpin == Mpin ) {
fundTrans(history, bal.peek(), a, bal);
}
else {
System.out.print("Invalid Pin...!!!\n");
}
break;
case 3:
transHistory(history,History,a);
break;
case 4:
Loan(bal);
break;
case 5:
BankDetails();
break;
case 6:
changeAcc(Mpin);
break;
default:
System.out.println("Invalid input!!");
break;
}
}while(cho!=0);

}

}
52 changes: 52 additions & 0 deletions Login.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
//System.out.print("");
package Project;
import java.util.*;
public class Login {
static Scanner sc = new Scanner(System.in);
@SuppressWarnings("rawtypes")
public static LinkedList<Stack> ll = new LinkedList<>();
public static void display(Stack<Double> history)
{
if(history.empty())
return ;
Double x = history.peek();
history.pop();
System.out.println(x);
display(history);
history.push(x);

}
@SuppressWarnings("unused")
public static void main(String[] args) {
System.out.println("Hello User!!!");
System.out.print("Name: ");
String name = sc.nextLine();
System.out.print("Set MPIN: ");
int mpin = sc.nextInt();
System.out.println("No of account to be added: ");
int n= sc.nextInt();
for(int i=0;i<=n-1;i++){
Stack<String> stk = new Stack<>();
System.out.println("\nBank name: ");
String BankAcc = sc.next();
stk.add(BankAcc);
System.out.print("IFSC code: ");
String ifcs = sc.next();
stk.add(ifcs);
System.out.print("Account no: ");
String acc = sc.next();
stk.add(acc);
System.out.print("CRN: ");
String crn = sc.next();
stk.add(crn);
ll.add(stk);
System.out.println("Account added Succefully!!!!");


}
System.out.println("\nUsing Account no 1");
Project.Feature.main(1,mpin);

}

}
35 changes: 23 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
# Buffer-4.0
Buffer is a Data Structures and Algorithms Project series, in which students can participate as mentees in teams of 3-4 people.
This year the themes on which students can create a project are-
Team Members
-Janhavi Gaikward
-Sanika Rudrawar
-Janvi Girase
-Aishwarya Pawar

1. Healthcare
2. Digital Society
3. Open Innovation
4. Custom data structure to store data
Domain:
Digital Socicety

This repository is created for all the teams to be able to upload their final project source code for the same.
Project Description-
Users:
Every person with Accounts in Bank
Functions:
-Can Check their balance of the accounts
-Transfer of Funds/Money
-Checking Transaction history
-Access to Loans
-Switching between accounts
-Check Account details
Data Structures and Algorithms Used:
-LinkedList
-Array List
-Stack

While submitting, note that:

Each folder should have the name of the team and inside a readme file with team member details, (name, year, branch) and their theme. The readme file should also contain the link to their presentation as well as the drive link where both the report documents would be stored.

Happy Coding :)
Link of Project Drive:
https://drive.google.com/drive/folders/1rMzBcLP3BsKULHaEz2F_-R5kxL84IgKm?usp=sharing