Question: Write a function named readOnePIN that reads in from the user a pin ( integer ) and ask the user re - enters the same
Write a function named "readOnePIN" that reads in from the user a pin integer and ask the user reenters the same pin to verify.
It will return the indicator of true or false match or not matched and the number of tries the user has attempted.
The user can enter the wrong pin up to only times.
Note: the function must return two separate values to the caller using return types and passbyreference parameters.
struct or tuple or pair is not allowed.
Printing is not allowed in the function. It can be done in the testing function or main.
Examples of the output of different program runs:
Please enter the pin:
Please reenter the pin:
Matched: true
Number of tries:
Please enter the pin:
Please reenter the pin:
Unmatched.
Please reenter the pin:
Unmatched.
Please reenter the pin:
Match: true
Number of tries:
Please enter the pin:
Please reenter the pin:
Unmatched.
Please reenter the pin:
Unmatched.
Please reenter the pin:
Unmatched.
Match: false
Number of tries:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
