Question: solve fast plzzz 11 Q3. Define a class named Payment that contains an instance variable of type double that stores the amount of the payment

solve fast plzzz
11 Q3. Define a class named Payment that contains an instance variable of type double that stores the amount of the payment along with appropriate values setting function. Also create a function named Payment Details that outputs an English sentence to describe the amount of the payment (like" Your due payment is 20000"). Next, define a class named CashPayment that is derived from Payment. This class should override the Payment Details function to indicate that the payment is in cash. Include appropriate constructor(s). Define a class named Credit CardPayment that is derived from Payment. This class should contain instance variables for the name on the card, expiration year, and credit card number. Include appropriate constructor(s). Finally, override the Payment Details function to include all credit card information in the printout. Create a main function that creates one CashPayment and one Credit CardPayment object with different values and calls Payment Details for each object. Also implement Dynamic polymorphism concept to show your understanding regarding dynamic polymorphism. [10 Marks)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
