Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started