Answered step by step
Verified Expert Solution
Question
1 Approved Answer
import java.io.*; public class Account implements Comparable , Serializable protected int accnum; protected HolderDetails holder; protected List transactions; protected float balance; // Add a suitable
import java.io.*; public class Account implements Comparable, Serializable protected int accnum; protected HolderDetails holder; protected List transactions; protected float balance; // Add a suitable constructor here /1 Add methods to make deposits / withdrawals // Method to print out account transaction summary // Add suitable attribute accessor methods // Add method to implement the Comparable interface a: Complete the implementation of the Account class, providing a suitable constructor, attribute accessor methods, methods for making a deposit or withdrawal, a method to print out a transaction summary related to a range of dates and an implementation method for the Comparable interface. 7 MARKS b: Provide implementations for the HolderDetails class and the Transaction class. The HolderDetails class is used to store personal details about the account holder. The Transaction class contains details about past transactions including the type of transaction, the amount and the Date. 7 MARKS c: Define and implement a new class, called CurrentAccount, derived from Account, that allows withdrawals to proceed up to some overdraft limit. Note that the base Account class shown has no overdraft facility import java.io.*; public class Account implements Comparable, Serializable protected int accnum; protected HolderDetails holder; protected List transactions; protected float balance; // Add a suitable constructor here /1 Add methods to make deposits / withdrawals // Method to print out account transaction summary // Add suitable attribute accessor methods // Add method to implement the Comparable interface a: Complete the implementation of the Account class, providing a suitable constructor, attribute accessor methods, methods for making a deposit or withdrawal, a method to print out a transaction summary related to a range of dates and an implementation method for the Comparable interface. 7 MARKS b: Provide implementations for the HolderDetails class and the Transaction class. The HolderDetails class is used to store personal details about the account holder. The Transaction class contains details about past transactions including the type of transaction, the amount and the Date. 7 MARKS c: Define and implement a new class, called CurrentAccount, derived from Account, that allows withdrawals to proceed up to some overdraft limit. Note that the base Account class shown has no overdraft facility
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