Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Understanding Databases Concepts And Practice

Authors: Suzanne W Dietrich

1st Edition

1119827949, 9781119827948

More Books

Students also viewed these Databases questions

Question

What is the education level of your target public?

Answered: 1 week ago

Question

=+applying to all or most employers and employees?

Answered: 1 week ago

Question

=+associated with political parties and if so, which ones? Are

Answered: 1 week ago