Question: function named readNumUntilFirstNumRepeated that reads in a list of numbers until the user enters the first number again. It will return the total count of

function named "readNumUntilFirstNumRepeated" that reads in a list of numbers until the user enters the first number again. It will return the total count of numbers the user has entered and the value of the first number. Please note that first number should be counted only once. Mote: 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 ; cout << "Count: " << readNumUntilFirstNumRepeated(value) << endl ; cout << "Value of the first number: " << value << endl; and its expected input/output from several separate runs: Please enter numbers until the first is repeated: 10 20 30 40 10 Count: 4 Value of the first number: 10 Please enter numbers until the first is repeated: 10 10 Count: 1 Value of the first number: 10 Please enter numbers until the first is repeated: 50 10 50 Count: 2 Value of the first number: 50

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 Programming Questions!