Write a program for an application that does not tolerate erroneous input data. Therefore, the data values are prepared by entering them twice by the user. Two lists are made by getting positive integers from the user, separated by a negative number. These two lists of numbers should be identical; if they are not, then a data entry error has occurred.

• Example:
User enters list
17
14
8
-5
17
14
8
The lists are identical. However see the following input

User enters list
17
14
8
-5
17
12
8
Program should show data entry error.

First you have to use a loop to find the negative value. Once found, start another loop to compare each of the values from the beginning of the array to the one past the negative number.

For example: let int i be a counter that finds the negative number. Let j be a counter the counts from 0 up to the value of i (where the negative value is located) Now, in a loop compare array[i[ with array[j], then if they are the same increment both i and j. If it gets to the end of the array then both arrays are identical.

And no, I won't write it for you -- its your job to figure out how to do it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.