Question: C++ Practice 1: Base Class Define a class named Payment that contains: A member variable of type float that stores the amount of the payment
Practice 1: Base Class Define a class named Payment that contains: A member variable of type float that stores the amount of the payment Appropriate accessor and mutator functions A member function named paymentDetails that outputs an English sentence that describes the amount of the payment. Practice 1: Derived Classes Next define a class named CashPayment that is derived from Payment. This class should redefine the paymentDetails function to indicate that the payment is in cash. Include appropriate constructor(s). Practice 1: Derived Classes (cont.) Define a class named CreditCardPayment that is derived from Payment. - This class should contain member variables for the name on the card, expiration date, and credit card number - Include appropriate constructor(s) Redefine the paymentDetails function to include all credit card information in the printout. Practice 1: Testing Create a main method that creates at least two CashPayment and two CreditCardPayment objects with different values and calls paymentDetails for each reate objects ash 1 details: The cash paynent anount is 50.5 ash 2 details The cash paynent anount is 20.45 redit 1 details: he credit card payment anount is 10.5 The name on the card is: Fred he expiration date is: 10/5/2010 he credit card number is: 12345 redit 2 detai ls: The credit card payment amount is 100 The name on the card is: Barney The expiration date is: 11/15/2009 The credit card number is: 9876 Practice 1: Testing (cont.) int main() ( cout
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
