Question: In C + + General requirements: - No global variables - No multiple return statements in one function - Show how you have tested these
In C
General requirements:
No global variables
No multiple return statements in one function
Show how you have tested these functions
You can use cin and cout in this function but please do not print out the results.
It should return the values to the caller through the use of return type and passbyreference parameters.
Please do not use struct, tuple or pair class.
Please use only passbyreference parameters and return type to return values to the caller.
Please do not use arrays. Please use only simple variables to keep track of the information.
Note: this is an exercise to use functions and not arrays.
Question #:
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:
Question #:
Write a function named "countScores" that will accept a count as the total number of scores to be read in by the function.
After reading the list of scores integer it will return the following statistical data for those scores:
total scores minus the largest and the smallest
boolean flag indicating whether all scores are passing meaning greater or equal
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 output of different program runs:
If it is passing to the function
Please enter the scores:
Total scores:
Passing: false
If it is passing to the function
Please enter the scores:
Total scores:
Passing: false
If it is passing to the function
Please enter the scores:
Total scores:
Passing: true
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
