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 autograding 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 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 methods When you are confident that your method is structurally and logically correct, then submit your code to the autograder for feedback. Your code should pass Structure test and Logic tests and before you continue.
Part 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 and a balance of is passed as an argument this method will print out to the terminal, a message exactly like the following:
Account number :
Account holder name : Bob Smith
Account Balance : $
If this method is called with a BankAccount with a different account holder name like Anika Patel and a different account number like and a different balance like then the message will be different, like this:
Account number :
Account holder name : Anika Patel
Account Balance : $
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 methods When you are confident that your method is structurally and logically correct, then submit your code to the autograder for feedback. Your code should pass Structure test and Logic tests and before you continue.
Part 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 nonprimitive 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 and a second augment value of the service fee then after this method returns, the value stored in the BankAccount object's accountBalance attribute will be
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 methods When you are confident that your method is structurally and logically correct, then submit your code to the autograder for feedback. Your code should pass Structure test and Logic tests and before you continue.
Part 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
