Question: Write a Java program that uses an one-dimensional array to solve the following program. Write an application that inputs six numbers [Keep the numbers in

Write a Java program that uses an one-dimensional array to solve the following program.

Write an application that inputs six numbers [Keep the numbers in an array]. The numbers can be between 20 and 200, inclusive. When a number is entered, display the number only if it is not a duplicate of a number already entered. Provide for the worst case in which all six numbers are different. Display the complete set of unique values input after the user enters each new value.

Output Example Scenario:

Enter number: 21 // prompt again

21 //display the number kept in the array

Enter number: 32 // prompt again

21 32 //display all entered numbers in the array each time after a new number is added

Enter number: 23

21 32 23

Enter number: 23

23 has already been entered //display message if a duplicate number is entered

Enter number: 33

21 32 23 33

Please add comments to make it understandable and also please provide code screenshot.

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!