Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please help fix, thank you import java.util.Scanner; public class unique public static void main(String args[]) Scanner input = new Scanner( System.in); // To do 1:
please help fix, thank you
import java.util.Scanner; public class unique public static void main(String args[]) Scanner input = new Scanner( System.in); // To do 1: create an array of five elements int count = 0; // number of uniques read int entered =0; // number of entered numbers while (entered numbers.length) System.out.print("Enter a number: "); // To do 2: write the code to retrieve the input from user //validate the input // To do 3: write if statement that validates the input 110, 1007 if ( 1 // flags where this number already exists boolean contains Number = false; //increment number of entered numbers entered++; To do 4: Compare the user input to the unique numbers in the array + using a for statement. If the number is unique continue / not already // add input to the array only if the number is if (!contains Number) // To do 5: write code to add the number to the array and increment unique items input 17/ end if else System.out.printf("%d has already been entered ", number); } // end if else System.out.println("Number must be between 10 and 100"); // print the list of unique values // To do 6: Write a for loop to output unique values }// end while } // end class UniqueStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started