The java program developed here is to implement bank functionality. The user can create an account, check, deposit money, withdraw, and also search account. At first, we created an interface called the central bank to do a few operations mentioned above. Then we created three subclass UNB, FGB, and NBD these classes will take customer account details and then we created a class Bankdriver to invoke all the methods in the subclasses.
Implementing classes/ interfaces namely Customer, Account, and CentralBank with required member variables and functions
Implementing the subclasses UNB, NBD, and FGB with required member variables and functions
UNB:
NBD:
FGB:
Implementing BankDriver class for creating the objects of subclasses and invoking their methods
System.out.println( " 1.Create an account \n2. Display all account details \n 3. Search by Account number\n 4. Deposit the amount \n 5. Withdraw the amount \n 6. Remove account\n 7.Exit " );
System.out.println( "Enter your choice: " ); ch = sc.nextInt(); case 1 : CentralBank cus = createAccount(C); if (cus != null ) < if (C.isEmpty())< System.out.println( "No accounts found" ); for ( int i = 0 ; i < C.size(); i++) < C.get(i).showAccount(); System.out.print( "Enter account no. you want to search: " ); String ac_no = sc.next(); boolean found = false ; for ( int i = 0 ; i < C.size(); i++) < found = C.get(i).search(ac_no); System.out.println( "Search failed! Account doesn't exist. " ); System.out.print( "Enter Account no. : " ); ac_no = sc.next(); found = false ; for ( int i = 0 ; i < C.size(); i++) < found = C.get(i).search(ac_no); System.out.println( "Enter the amount to deposit" ); long amount = sc.nextLong(); C.get(i).deposit(amount); System.out.println( "Search failed! Account doesn't exist. " ); System.out.print( "Enter Account No : " ); ac_no = sc.next(); found = false ; for ( int i = 0 ; i < C.size(); i++) < found = C.get(i).search(ac_no); System.out.println( "Enter the amount to withdraw" ); long amount = sc.nextLong(); C.get(i).withdraw(amount); System.out.println( "Search failed! Account doesn't exist.!" ); System.out.println( "Enter your acc no: " ); String temp = sc.next(); found = false ; for ( int i = 0 ; i < C.size(); i++) < found = C.get(i).search(temp); System.out.println( "Account deleted successfully" ); System.out.println( "Search failed! Account doesn't exist.!" ); case 7 : break ; default : System.out.println( "Enter the correct Choice" ); while (ch != 7 );Output:
Like Article -->This is the Part 4 of "Build a Social Media App on Android Studio" tutorial, and we are going to cover the following functionalities in this article: We are going to retrieve data of users From Firebase.This is a simple fragment in which we will retrieve data of users like name, email, and profile pic from real-time Database and showing that in tex
3 min read How to Implement Search for a Registered User Functionality in Social Media Android App?This is the Part 9 of "Build a Social Media App on Android Studio" tutorial, and we are going to cover the following functionalities in this article: We are going to Search For a user on the Users Page.If there are few people registered in our app then it is easy to search for a person.But what happens when we have 1000 users registered in our app
3 min read Implement Like a Blog Post Functionality in Social Media Android AppThis is the Part 10 of "Build a Social Media App on Android Studio" tutorial, and we are going to cover the following functionalities in this article: We are going to Like a Blog. We are implementing this feature using two images one like button with white background and another like button with blue background.When the user clicks on the button fo
5 min read Implement Comment on a Particular Blog Functionality in Social Media Android AppThis is the Part 11 of "Build a Social Media App on Android Studio" tutorial, and we are going to cover the following functionalities in this article: We are going to comment on the blog.Here we are going to write a comment, and then we will be showing the comments and will be updating the comment count.The comment feature is the best feature in an
9 min read Implement Delete a Blog Post Functionality in Social Media Android AppThis is the Part 13 of "Build a Social Media App on Android Studio" tutorial, and we are going to cover the following functionalities in this article: We are going to delete the Blog written by the user.Blogs can only be deleted by the owner of blogs. In the top right of the blog, a button is there.After clicking on that a popup will come in that D
5 min read How to Implement Chat Functionality in Social Media Android App?This is the Part 14 of "Build a Social Media App on Android Studio" tutorial, and we are going to cover the following functionalities in this article: We are going to Create a Layout for chat & Send Messages in Chat.A user can send either a Message or an Image.A user can send an image either using a camera or gallery.Firstly a request for permi
15+ min read Implement Delete Messages Functionality in Social Media Android AppThis is the Part 15 of "Build a Social Media App on Android Studio" tutorial, and we are going to cover the following functionalities in this article: We are going to delete the message in the ChatActivity.We are going to delete text and image messages. When we click on a text then an AlertBox will come.There will be two options to either delete th
4 min read ReactJS Calculator App (Adding Functionality)Now, we had built the structure of our UI, but we haven't added styles to it either we have added any functionality. So, in this article, we will try to make our Calculator app fully functional. Once our app becomes functional, we will add CSS to style the App. So, let's begin. The very first functionality we will add it for the click event of the
4 min read Creating a Customizable Dashboard with React and Drag-and-Drop functionalityIn this article, we will create a Dashboard with a drag-and-drop functionality using React JS. This project basically implements useState principles and the use of vite to set up the run time environment of React and JavaScript. The drag and drop functionality will enable the user to drag from one container and drop the picked element into the othe
4 min read Implementing Edit Profile Data Functionality in Social Media Android AppThis is the Part 3 of "Build a Social Media App on Android Studio" tutorial, and we are going to cover the following functionalities in this article: We are going to edit our profile data like changing name, changing the password of the user, and changing profile pic.Changing password is a very important feature because it may happen that sometimes
10 min readImplementing Search for a Specific Blog On Home Page and Logout Functionality in Social Media Android App
This is the Part 7 of "Build a Social Media App in Android Studio" tutorial, and we are going to cover the following functionalities in this article: We are going to Search For a Blog on Home Page.If there are few blogs in our app then it is easy to search for a blog manually. But what happens when we have 1000 blogs then search for a particular bl
4 min read How to Implement AOP in Spring Boot Application?AOP(Aspect Oriented Programming) breaks the full program into different smaller units. In numerous situations, we need to log, and audit the details as well as need to pay importance to declarative transactions, security, caching, etc., Let us see the key terminologies of AOP Aspect: It has a set of APIs for cross-cutting requirements. Logging modu
10 min read Spring Boot - application.yml/application.yaml FileSpring is widely used for creating scalable applications. For web applications Spring provides. In Spring Boot, whenever we create a new Spring Boot Application in spring starter, or inside an IDE (Eclipse or STS) a file is located inside the src/main/resources folder named as application.properties file which is shown in the below media: So in a s
4 min read Difference between a Java Application and a Java AppletJava Application is just like a Java program that runs on an underlying operating system with the support of a virtual machine. It is also known as an application program. The graphical user interface is not necessary to execute the java applications, it can be run with or without it. Java Applet is a Java program that can be embedded into a web pa
3 min read Menu-Driven Program for Bank Management SystemPrerequisite: Switch Case in C/C++Problem Statement: Write a program to build a simple Bank Management System using C++ which can perform the following operations: Open accountDeposit MoneyWithdraw MoneyDisplay Account Approach: Below is the approach to do the above operations: Open Account: This method takes details from the customer like name, ad
10 min read Validating Bank Account Number Using Regular ExpressionsA bank account number is a unique number that is assigned to the account holder after opening their account in any specific bank. In technical terms, we can consider the Bank account number as the Primary Key. A bank account number enables us to do debit, credit, and other transactions. As per RBI Guidelines, Bank Account Number has a unique struct
6 min read Maven Project with JUnit - Checking for a Bank Account NumberIn banking software or financial software, validation of an account number is a mandatory scenario. In this article, as a sample let us take a valid account number To contain only 14 digitsAll 14 digits cannot be zerosThe account number cannot be null or cannot be empty. With this let us prepare a maven project to have this business logic in 3 diff
4 min read Bank of America (BA Continuum) Interview Experience | On-Campus 2020Bank of America visited our campus in the month of December 2020, for the role of Senior Tech Associate for a full-time offer. There were 3 rounds this time and there was a slight difference in the recruitment process as this time the first round was a video interview round with 2 coding questions. Anybody having good knowledge of Java and SQL can
4 min read How to Get Bank Details from IFSC Code in Android?Many apps such as the E-commerce app requires to accept payments from their users for providing different products or services or for their users. So this apps requires the users to enter bank details for payments. In this payment gateway, users are asked to add their banks IFSC code to get the details of their banks. So many apps have features ins
6 min read Implement PriorityQueue through Comparator in JavaPrerequisite : Priority Queue, Comparator Priority Queue is like a regular queue, but each element has a "priority" associated with it. In a priority queue, an element with high priority is served before an element with low priority. For this, it uses a comparison function which imposes a total ordering of the elements. The elements of the priority
3 min read Implement Pair Class with Unit Class in Java using JavaTuplesTo implement a Pair class with a Unit class in Java using JavaTuples, you can use the Pair class provided by the library and create a new Unit class that extends the Unit class provided by the library. Here is an example implementation: Here is an example Java code that uses the MyPair class with MyUnit and displays the output: Java Code import org
4 min read Implement Triplet Class with Pair Class in Java using JavaTuplesFollowing are the ways to implement Triplet Class with Pair Class Using direct values import java.util.*; import org.javatuples.*; class GfG < public static void main(String[] args) < // create Pair Pair<Integer, String> pair = new Pair<Integer, String>( Integer.valueOf(1), "GeeksforGeeks"); // Print the Pair System.out.printl
2 min read Implement Quintet Class with Quartet Class in Java using JavaTuplesFollowing are the ways to implement Quintet Class with Quartet Class Using direct values import java.util.*; import org.javatuples.*; class GfG < public static void main(String[] args) < // create Quartet Quartet<String, String, String, String> quartet = new Quartet<String, String, String, String>( "Quartet", "Triplet
4 min read Implement Quartet Class with Triplet Class in Java using JavaTuplesFollowing are the ways to implement Quartet Class with Triplet Class Using direct values import java.util.*; import org.javatuples.*; class GfG < public static void main(String[] args) < // create Triplet Triplet<String, String, String> triplet = new Triplet<String, String, String>( "Triplet 1", "1", "GeeksforGe
3 min read Implement Octet Class from Septet Class in Java using JavaTuplesPrerequisite: Octet Class, Septet Class Below are the methods to implement a Octet Class using Septet Class in Java: Using direct values // Java program to illustrate // implementing Octet Class // from Septet Class // using direct values import java.util.*; import org.javatuples.*; class GfG < public static void main(String[] args) < // Create Sep
6 min read Implement Ennead Class from Octet Class in Java using JavaTuplesPrerequisite: Ennead Class, Octet Class Below are the methods to implement a Ennead Class using Octet Class in Java: Using direct values // Java program to illustrate // implementing Ennead Class // from Octet Class // using direct values import java.util.*; import org.javatuples.*; class GfG < public static void main(String[] args) < // Create Oct
7 min read Implement Sextet Class from Quintet Class in Java using JavaTuplesPrerequisite: Sextet Class, Quintet Class Below are the methods to implement a Sextet Class using Quintet Class in Java: Using direct values // Java program to illustrate // implementing Sextet Class // from Quintet Class using // direct values import java.util.*; import org.javatuples.*; class GfG < public static void main(String[] args) < // crea
5 min read Implement Septet Class from Sextet Class in Java using JavaTuplesPrerequisite: Septet Class, Sextet Class Below are the methods to implement a Septet Class using Sextet Class in Java: Using direct values // Java program to illustrate // implementing Septet Class // from Sextet Class // using direct values import java.util.*; import org.javatuples.*; class GfG < public static void main(String[] args) < // Create
6 min read Implement Decade Class from Ennead Class in Java using JavaTuplesPrerequisite: Decade Class, Ennead Class Below are the methods to implement a Decade Class using Ennead Class in Java: Using direct values // Java program to illustrate // implementing Decade Class // from Ennead Class // using direct values import java.util.*; import org.javatuples.*; class GfG < public static void main(String[] args) < // Create
8 min read How to implement our own Dynamic Array class in Java?Given task is to implement a class in Java which behaves just like the Dynamic array using ArrayList. ArrayList is same as dynamic arrays with the ability to resize itself automatically when an element is inserted or deleted, with their storage being handled automatically by the container. ArrayList elements are placed in contiguous storage so that