--- Write a program for a bank system. Your program should use a linked list to
ID: 3535859 • Letter: #
Question
---
Write a program for a bank system. Your program should use a linked list to save customer name and linked list to save account number and the balance of the account .your program should have a menu to do the following: Create account: take customer name and display list of account. Create an account based on customers request and insert the balance. Account number should generated randomly .if the customer already has that account type, you should inform him. Deposit: take the account number and balance and despite the amount only if the account exists. Search a customer: take the name of a customer and check if he exists in the system. Print account numberand balance of each account. Otherwise inform the user that customer was not found. Delete a customer: take the name of customer and delete him from the system. Inform the user if the customer was found or not. Print all customer information: print all customer and account information in the system.Explanation / Answer
import java.util.*; class banking { public static void main(String[] args) { savings a=new savings(); current b=new current(); Scanner inp=new Scanner(System.in); int x,y,z; System.out.println("1:savings 2:current"); x=inp.nextInt(); switch(x) { case 1:String actype="savings"; System.out.println("enter ac no"); int acno=inp.nextInt(); String cusname="puja"; System.out.println(cusname); a.getdata(actype,acno,cusname); do{ System.out.println("1:balance enq 2:deposit 3:withdrawl 4:interest"); y=inp.nextInt(); switch(y) { case 1:System.out.println("bal is"+a.print()); break; case 2:System.out.println("enter amount"); float dep=inp.nextFloat(); a.deposit(dep); break; case 3:System.out.println("amount to withdrawl"); float wdr=inp.nextFloat(); a.withdrawl(wdr); break; case 4:System.out.println("interest for how many years"); int n=inp.nextInt(); a.interest(n); break; default:break; } }while( yRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.