Question: Objective: Working with basic types and more with loops and arrays Pin code security check: Write a C program to validate the security pin codes

Objective: Working with basic types and more with loops and arrays Pin code security check: Write a C program to validate the security pin codes in the following way: . It first checks if the pin code entered is six digits. If not, the code is invalid. . It then checks if each digit within the six-digit pin is divisible by 2. If not, the code is invalid. It then checks if the sum of all the digits is less than 30, then the code is invalid. . If ten consecutive invalid pins are entered, the system locks out and reports an intruder. Therefore, codes 357 and 162348 are invalid because the former is less than six digits and the latter has numbers which are not divisible by 2 (i.e. 1 and 3). A valid pin code could be 622248 because it has exactly six digits. In addition, all of its six digits (i.e., 2, 4, 6, and 8) are divisible by 2 and sum of digits (24) is less than 30. A sample interaction is shown below Enter pin code (attempt 1): 1234567 Code 1234 is invalid! Enter pin code (attempt 2): 122534 Code 122534 is invalid! Enter pin code (attempt 3): 642642 Congratulation, code 642642 is valid! If the user entered more than 10 invalid pins: Intruder alert! Note: You can find digits of the pin code and store them in an array first
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
