Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Java language The main.java is already completed. I just need the BankAccount.java part. back to classroom Duer Jon 08, 2019 11:59 p submit L3 nstructions
Java language The main.java is already completed. I just need the BankAccount.java part. back to classroom Duer Jon 08, 2019 11:59 p submit L3 nstructions from your teacher 6 class Hain ( 7-public static vold main(Stringt) args) ( BankAccount ba new Bankaccount("3ohn Smith,300) ba.deposit(-10) ba.wlthdraut-100); ba.wl thdrav(400) ba.deposit(1e0); ba.withdrau(400): System.out.print (ba)i 10 12 13 14 15 1. Add the instance variables for name and balance 2. Add the methods deposit and withdraw (make sure you cant withdeaw more than you have in your account) Also be sure all withdarwals and deposits are positive (should not allow a negative amount Add a standard contstructor Add a toString S. Run the program to check your class java version "1.8.8 31 ava(TM) SE Runtine Enviroment (build 1.8.0 31-b13) ava HotSpot(IM) 64-Bit Server VM (bulld 25.)1-be7, mixed-ode) Display a message to the screen whenever an illegal deposit or withdrawal is attempted Develop a new class called BankAccount. A bank account has an owner's name and a bal- ance. Be sure to include a constructor that allows a client to supply the owner's name and an ini- tial balance. A bank account needs accessors for the name and balance, mutators for making deposits and withdrawals, and a tostring method. Test-drive your new class with a program similar to the one used to test the Student class in Section 6.3
Java language
The main.java is already completed. I just need the BankAccount.java part.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered 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