Question
Please help me with the coding of this in JAVA. I have tried for a week to write it with no prevail! Account Class General
Please help me with the coding of this in JAVA. I have tried for a week to write it with no prevail!
Account Class General Requirements The generic BASE class Account will serve as the parent class to Checking, Savings and CreditCard. Variables (protected): name Name of account owner, a string taxID social security number, a long balance an amount in dollars, a double last10withdraws a double array of size 10. The last 10 withdrawal amounts. last10deposits a double array of size 10. The last 10 deposit amounts. numdeposits number of deposits, an int numwithdraws number of withdrawals, an int Methods: SetName, SetTaxID, Setbalance() assigns a new value for each with error checking GetName, GetTaxID, Getbalance() returns a value for each variable. MakeDeposit( double amount ) - adjust the balance and put it in the deposit array display() a method to display the name, taxID and balance. Constructor: A constructor with no parameters and one with name, taxID and balance as parameters
Checking Class General Requirements A specific DERIVED class that represents a bank checking account. It must inherit (extends) Account. Variables (private): last10checks an int array of size 10. The last 10 check numbers. Methods: WriteCheck( int checknum, double amount ) - adjust the balance and list it as a withdraw in the base class display() - display the accounts check register (number and amount) and deposit record. Constructor: A constructor with no parameters and one with name, taxID and balance parameters
Savings Class General Requirements A specific DERIVED class that represents a bank savings account. It must inherit Account. Methods: DoWithdraw( double amount) - adjust the balance and list it as a withdraw in the base class display() - display the accounts withdrawal and deposit record Constructor: A constructor with no parameters and one with name, taxID and balance
CreditCard Class General Requirements A specific DERIVED class that represents a credit card account. It must inherit Account. Variables (private) : cardnumber a long last10charges a string array of size 10. The last 10 names of the charges. Methods: DebitCharge( string name, double amount ) - adjust the balance and list it as a withdraw in the base class MakePayment( double amount) - adjust the balance and list it as a DEPOSIT in the base class display() - display the accounts charges ( name and amount ) and deposit record Constructor: A constructor with no parameters and one with name, taxID and balance parameters Note: all display() methods should use the println method to output text to the console.
Write a main() Function RunBank Class Write a main that creates 3 objects, starts each with a balance of $100. Create a loop that displays the following menu each time through the loop. Make sure the balance is updated each time AND you use the objects to perform the transactions.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored 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