Question: Please write it in C++ Important requirements for all questions: No global variable is allowed to be declared and used. Constants are ok. Functions cannot

Please write it in C++
Important requirements for all questions:
No global variable is allowed to be declared and used. Constants are ok.
Functions cannot use cin or cout unless it is explicitly permitted. It should
make use of parameters and return value instead. cin and cout should be done
in main() or any testing functions
Multiple return statements in one function are not allowed.
The function cannot use the string class or string functions such as strlen. It
should only manipulate C-string as an array of chars with NULL at the end.
Please clearly show how you test your functions with at least the provided test
data
 Please write it in C++ Important requirements for all questions: No

Write a function named "readNumUntilRepeated" that reads in a list of numbers until the user repeats the last or first number. It will return the total count of numbers the user has entered and the value of the first and last numbers. Please note that first or last number should be counted only once. When the user ends the list with the first number, the last number will be the last one before that number. Note: this function will use "cout" to prompt and "cin" to read in the numbers, but it will return the values to the caller. Here is an example of a test call: int value =0, first =0, last =0; cout "Count: " readNumUntilRepeated(first, last) endl ; cout "Value of the first number: "

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!