Q016 - Product Payment by Overloading
Q016 - Product Payment by Overloading
Mr. Jordon operates a HyperMart in MetaCity, where customers can buy products that meet
their daily requirements. Multiple sales executives are employed to fill the stock on shelves and
help customers while buying the product, etc. Initially, the mode of payment for purchasing the
product was cash, but due to digitalization, Mr. Jordon decided to implement an automated
system where customers can pay through cash, wallet, or debit / credit card.
Mr. Jordon contracted High Tech Solutions to develop such an automated system. He provided
the requirement specifications containing basic fields like Customer Name, Contact, and
Product Name to this software development company.
[Note : Strictly adhere to the object-oriented specifications given as a part of the problem
statement.
Follow the naming conventions as mentioned. Create separate classes in separate files.]
High Tech Solutions decided to create a class called Product with the following private member
variables
Consider another class called Payment where they define the following methods
Method Name Description
public void
When the payment mode is "Cash Payment", then get the
MakePayment(doubl
amount and display the payment details.
e amount)
public void
MakePayment(string When the payment mode is "Wallet Payment", then get the
walletNumber, amount, wallet number and display the payment details.
double amount)
public void
MakePayment(string
When the payment mode is "Card Payment", then get the
creditCard, string ccv,
amount, credit card details and display the payment details.
string name, double
amount)
Consider another class Program and write a Main method to test the above class.
In the main method, get the product details, payment mode details and call the corresponding
method and display the payment details.
Display ‘Please select the correct mode of payment...’ when user enter invalid mode of
payment.