You are required to develop a program that will operate on an ATM machine for a bank. Your program should allow bank customers to manage their PIN. The PIN is a 4-digit number. You can assume that the PIN has been initially assigned the number: 1234
Your program should be menu-driven and must display a simple menu when run. The menu should include the following options:
1. Enter PIN and verify correct
2. Change PIN
3. Display the number of times the PIN was entered (i) Successfully (ii) Incorrectly
4. Exit Program
The customer should be asked to select an option from the menu. After selecting an option, your program must do the following:
If they select option 1, they should be asked to enter their PIN - this must then be verified whether correct or incorrect.
If they select option 2, they should be allowed to change their PIN. When they enter the new PIN, your program must verify the new PIN by asking the customer to re-enter this new PIN. This will verify that the new PIN entered is correct and no errors were made. If there are any differences and the verification fails, your program must display an appropriate error message and the original PIN should remain the same.
If they select option 3, they should be shown the number of times their PIN was entered successfully and incorrectly.
If they select option 4, your program should terminate gracefully.
Your program should continually run and re-display the main menu after each option has completed, i.e. start over again. Only when the customer enters option 4 (i.e. Exit program option), should your program terminate.
The program should take account of input errors by the user and display appropriate error messages.