Question: ing variable named accountNumber, and the third attribute is a double named accountBalance - so each BankAccount object will know the name of the account

ing variable named accountNumber, and the third attribute is a double named accountBalance - so each BankAccount object will know the name of the account holder, the account number and its current balance. The BankAccount class also defines two operations. The first operation is a method named deposit, and the second operation is a method named withdraw - so each BankAccount will be able to deposit, and withdraw funds to and from its balance.
It can be very helpful to write some code in the main method to test the methods you are writing. It can also be helpful to submit your code for auto-grading after completing each part, and to make sure that you pass the Structure and Logic tests for each part before moving on to the next part.
Part 01- Make Checking Account
For this part you must write a public static method named makeBankAccount. This method will take two arguments. The first argument will be a String and the second argument will also be a String. This method must instantiate a new BankAccount object, then store the first argument value in the BankAccount object's accountHolderName attribute, and store the second argument value in the BankAccount object's accountNumber attribute. This method must also initialize the accountBalance variable of the BankAccount object to zero. Finally, this method must must return the new BankAccount object.
After you have finished writing this method, Run your code to find and then fix any syntax errors. You may also wish to write some other code (in the main method) to call and test your method(s). When you are confident that your method is structurally and logically correct, then submit your code to the auto-grader for feedback. Your code should pass Structure test 1 and Logic tests 1.1 and 1.2 before you continue.
Part 02- Display Account Info
For this part you must write a public static method named displayAccountInfo. This method will take a BankAccount reference as an argument, and it will return nothing. When called, and a BankAccount with an account holder named Bob Smith and and account number 21-573-6291 and a balance of 100.00 is passed as an argument this method will print out to the terminal, a message exactly like the following:
Account number : 21-573-6291
Account holder name : Bob Smith
Account Balance : $100.00
If this method is called with a BankAccount with a different account holder name (like Anika Patel) and a different account number (like 58-923-0042), and a different balance (like 2754.93)then the message will be different, like this:
Account number : 58-923-0042
Account holder name : Anika Patel
Account Balance : $2754.93
After you have finished writing this method, Run your code to find and then fix any syntax errors. You may also wish to write some other code (in the main method) to call and test your method(s). When you are confident that your method is structurally and logically correct, then submit your code to the auto-grader for feedback. Your code should pass Structure test 2 and Logic tests 2.1 and 2.2 before you continue.
Part 03- Charge Service Fee
For this part you must write a public static method named chargeServiceFee. This method will take a BankAccount as its first argument, and a double (repesenting a service fee anmount) as its second argument, and it will return nothing. This method will simply decrease the value of the accountBalance attribute of the BankAccount object by the amount of the second argument value.
Remember that, as non-primitive data types, BankAccount objects are passed by reference to methods. This means that the method will have access to make changes to the original BankAccount object. So, if we call this method and pass, as the first argument, a BankAccount object with a balance of 100.00, and a second augment value of 10.00(the service fee), then after this method returns, the value stored in the BankAccount object's accountBalance attribute will be 90.00.
After you have finished writing this method, Run your code to find and then fix any syntax errors. You may also wish to write some other code (in the main method) to call and test your method(s). When you are confident that your method is structurally and logically correct, then submit your code to the auto-grader for feedback. Your code should pass Structure test 3 and Logic tests 3.1 and 3.2 before you continue.
Part 04- Apply Interest
For this part you must write a public st

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 Programming Questions!