Skip to content

Tony-91/javaBanking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Withdraw, Deposit & check your balance in the NEW Java Banking App

public class bankAccount

First, we create a bankAccount class with 4 instance variables we'll be using thorughout the program:

  1. int balance;
  2. int previousBalance;
  3. String customerName;
  4. String customerID;

underneath that, we create our bankAccount constructor with 2 params.

deposit, withdraw & getPreviousTransaction methods

Next we create 3 methods that give our application functionaility yo do things.

  • deposit(), withdraw() and getPreviousTransaction() are comprised of math equations that fulfill each of their expected functions.
  • Later down the line the int amount variable will equal scan.nextInt() - the user's next int input.

showMenu()

The first block of code executed that acts as our aesthetics in terminal

  • initializes char option;

showMenu() - cont.

This methods also coninueously runs a do/while loop with 5 different switch options

Main

Stylistically - I like to keep my Main clean as possible.

  • Here, we create a new bankAccount instance and execute showMenu()

Finished product

Takeaways

  • Orgainization and style matter - easier to read and follow (by other and myself). Separation of concerns.
  • It's easier to break down a program by looking at its smaller blocks of code.
  • initialize -> constructor -> invoke new object

About

Banking application in Java!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages