Random generator and eliminate duplicates


Question:

C# and Java progs. Random generator and eliminate duplicates

1. Write a C# application that generates a 3-digit random number 100 times. Display the output for each of the generated numbers and the sum of all 100 numbers. Every 10th number you should display a String consisting of any phrase of your choice concatenated with the current random number.

A possible partial output for your program is shown below:
101
899
234
823
239
099
460
382
534
This 10th number is: 834

Demonstrate your code compiles and runs without issue. (You can use screen captures to demonstrate this functionality in a word document).

2. Submit your java file together with a text file containing your test data. Test data in this case is simply a list of inputs and corresponding outputs of your test program.

(Eliminating duplicates) Write a method to eliminate the duplicate values in the array using following method header:
Public static int [ ] eliminateDuplicates (int [ ] numbers)

Write a test program that reads in ten integers, invoke the method, and displays the result.

Here is the sample run of the program:

Enter ten numbers: 1 2 3 2 1 6 3 4 5 2 Enter
The distinct numbers are: 1 2 3 6 5 4

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Random generator and eliminate duplicates
Reference No:- TGS01937742

Now Priced at $20 (50% Discount)

Recommended (90%)

Rated (4.3/5)