We have a bank card class:
case class CreditCard(number: String, pin: Option[String])
There is a requirement to implement a method that would remind forgetful customers of their card PIN code. It should show the first 2 digits and the rest as asterisks. For example, PIN 1234 would be shown as 12**.
If there is no code, we output Please, set PIN to your card.
Use the higher order fold method to implement the necessary mechanics.