Problem Description:
Create a Payment System that allows the user to make payments through different methods (Credit Card, PayPal, Cash). Use polymorphism to define different payment methods using the same interface.
Location:
https://github.com/patil-rushikesh/cpp_programs/tree/main/Examples
Attributes:
Payment class (base class):
amount (float) – Amount to be paid.
CreditCard class:
cardNumber (string) – Credit card number.
expirationDate (string) – Expiry date of the credit card.
CVV (int) – Card Verification Value.
PayPal class:
email (string) – PayPal account email.
Cash class:
No additional attributes for cash payments.
Methods:
pay() – The method for processing a payment (to be overridden in each derived class).
The program should be menu-driven, allowing the user to:
- Choose a payment method (Credit Card, PayPal, Cash).
- Enter payment details.
- Process the payment (using the appropriate method based on the user's choice).
- Exit the program.
Requirements for the Issue:
- Create the base class Payment.
- Implement derived classes for CreditCard, PayPal, and Cash.
- Use function overriding to implement pay() differently for each payment method.
- Provide a menu-driven interface for interacting with the system.
Problem Description:
Create a Payment System that allows the user to make payments through different methods (Credit Card, PayPal, Cash). Use polymorphism to define different payment methods using the same interface.
Location:
https://github.com/patil-rushikesh/cpp_programs/tree/main/Examples
Attributes:
Payment class (base class):
amount (float) – Amount to be paid.
CreditCard class:
cardNumber (string) – Credit card number.
expirationDate (string) – Expiry date of the credit card.
CVV (int) – Card Verification Value.
PayPal class:
email (string) – PayPal account email.
Cash class:
No additional attributes for cash payments.
Methods:
pay() – The method for processing a payment (to be overridden in each derived class).
The program should be menu-driven, allowing the user to:
Requirements for the Issue: