Answered step by step
Verified Expert Solution
Question
1 Approved Answer
java solve for this problem Problem#1 Create a Banking System, where a user can create new account, deposit money, withdraw money and check the balance
java solve for this problem
Problem\#1 Create a Banking System, where a user can create new account, deposit money, withdraw money and check the balance of his/her account. What you need to do: 1) Create a BankAccount class which has 3 instance variables; name, accNum and balance. a. Create a constructor with 3 arguments and initialize the attributes. The class also has the following 4 methods; b. void deposit(double depAmount) - Inside the method the balance variable needs to be increased by the "depAmount" amount. c. void withdraw(double withAmount) - The balance is decreased by "withAmount" amount. We have to make sure the balance does not become negative. d. double getBalance() - The method returns the balance. e. void display() - This method displays the attributes in the format "Name:[name]; AccNum:[accNum]; Balance:[balance]". Use toString() method to get the formatted string. 2) Now create an application class (that has the main method) named "Bank" which will have the main method. In the main method, you need to create an account first. So, take input for the 3 fields (name, accNum, balance) from the user. After taking the input, create a BankAccount object. - After creating the account, you have to provide a menu on the console. It will take user input to decide what action to takeStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started