Answered step by step
Verified Expert Solution
Question
1 Approved Answer
How would I write the addpurchase and delete purchase methods using java? Requirements: The Cardholder class is an abstract class from which other cardholder classes
How would I write the addpurchase and delete purchase methods using java?
Requirements: The Cardholder class is an abstract class from which other cardholder classes are derived. It contains fields and methods that will be inherited by the classes derived from Cardholder. Design: The Cardholder class has fields, a constructor, and methods as outlined below (1) Fields: category, acctNumber, name (all String objects), prevBalance of type double, payment of type double, an array of type double representing new purchases; and a public constant INTEREST_RATE set to 0.01 (a double). The instance variables should be protected rather than private. (2) Constructor: The constructor accepts String objects for the card holder's acctNumber and name as and assigns the fields accordingly. The constructor should also create the purchases array of type double with initial length of 0 and assign the field. (3) Methods: Usually a class provides methods to access and modify each of its instance variables (i.e., getters and setters) along with any other required methods. The methods for Cardholder are described belowStep 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