Design and implement the following classes:
a. Consider the abstract base class Transaction defined in the previous exercise. Derive a class named Purchase from the Transaction class. This class should contain various details required for making a purchase from an organization’s point of view. It should also have the functionality for calculating the purchase amount.
b. Derive two classes CashPurchase and CreditPurchase from the base class Purchase . The CashPurchase class should have a member variable for storing the discount received from the retailer. The class CreditPurchase should have a member variable storing the date of payment.
c. Derive two classes CashSale and CreditSale . The CashSale class should have a member variable for storing the discount paid to the customer. The class CreditSale should have a member variable for storing the date of receipt of payment from the customer.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here