Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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 take

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2014 Nancy France September 15 19 2014 Proceedings Part I Lnai 8724

Authors: Toon Calders ,Floriana Esposito ,Eyke Hullermeier ,Rosa Meo

2014th Edition

3662448475, 978-3662448472

More Books

Students also viewed these Databases questions

Question

Discuss what is meant by quality is a virtue of design.

Answered: 1 week ago