#K76652. Transaction Validator
Transaction Validator
Transaction Validator
You are given details of a financial transaction. Your task is to validate the transaction based on the following rules:
- Amount: The transaction amount should be greater than 0.
- Currency: The currency must be one of the accepted currencies: \( USD, EUR, GBP \).
- Card Number: The card number must be exactly 16 digits, and must contain only numbers.
- Expiry Date: The expiry date is provided in the format \( mm/yy \) and it must represent a valid date in the future.
- CVV: The CVV must be exactly 3 digits.
Your program should read the transaction details from standard input and output True
if the transaction is valid or False
otherwise.
inputFormat
The input consists of 5 lines:
- A floating-point number representing the transaction amount.
- A string representing the currency.
- A string representing the card number (exactly 16 digits).
- A string representing the expiry date in the format mm/yy.
- A string representing the CVV (exactly 3 digits).
outputFormat
Output a single line with True
if the transaction meets all the criteria; otherwise, output False
.
100.0
USD
1234567812345678
12/25
123
True
</p>