subject

/** * Write a description of class unique here. * * @author Qi Zhu * @version (a version number or a date) */ 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 [10, 100] if () { // flags where this number already exists boolean containsNumber = 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 */ // add input to the array only if the number is not already if (!containsNumber) { // To do 5: write code to add the number to the array and increment unique items input } // end if else System. out. printf("%d has already been entered\n", 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 Unique }

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 20:00
What is used to analyze and summarize your data without graphical support
Answers: 1
question
Computers and Technology, 24.06.2019 02:30
Assume a class window with accessor method getwidth that accepts no parameters and returns an integer. assume further an array of 3 window elements named winarr, has been declared and initialized. write a sequence of statements that prints out the width of the widest window in the array.
Answers: 2
question
Computers and Technology, 24.06.2019 20:20
Write python code that prompts the user to enter his or her age and assigns the user’s input to an integer variable named age.
Answers: 1
question
Computers and Technology, 24.06.2019 22:30
The a great imaginary circle, or reference line, around earth that is equally distant from the two poles and divides earth into the northern and southern hemispheres.
Answers: 1
You know the right answer?
/** * Write a description of class unique here. * * @author Qi Zhu * @version (a version number or a...
Questions
question
Mathematics, 26.02.2020 21:23
question
History, 26.02.2020 21:23
question
Mathematics, 26.02.2020 21:23
question
Mathematics, 26.02.2020 21:24
question
History, 26.02.2020 21:24
Questions on the website: 13722359