Question: Java OOP Name : Sid Id : 20 balance : 10000 Problem#1 Create a Banking System, where a user can create new account, deposit money,

Java OOP Java OOP Name : Sid Id : 20 balance : 10000 Problem#1 Name : Sid Id : 20 balance : 10000

Problem#1 Create a Banking System, where a user can create new account, deposit money, withdraw money and check the balance What you need to do: 1) Create a BankAccount class which has 3 instance variables; name, id and balance. a. Create a constructor that takes initial value for those 3 attributes and initializes those attributes. Create the following 4 methods as described; a. void deposit(double depAmount) Inside the method the balance need to be increased by the "depAmount" amount. b. void withdraw(double withAmount) Inside the method decrease the balance by with Amount" amount. Do necessary checks so that the balance do not become negative. c. double getBalance() The method returns the balance. d. void display() This method displays the attributes in the format "Name:[name]; Id:[id]; Balance:[balance)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!