Explore BrainMass
Share

Explore BrainMass

    C# and Java progs. Random generator and eliminate duplicates

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    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

    © BrainMass Inc. brainmass.com October 10, 2019, 4:22 am ad1c9bdddf
    https://brainmass.com/computer-science/random-number-generation/c-sharp-java-applications-random-number-generation-examples-457717

    Solution Preview

    Attached you will find following files:

    C# Task:
    Program.cs - C# source ...

    Solution Summary

    Provides steps to create both C# and Java applications.

    $2.19