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 11:40
Pthreads programming: create and terminate a thread write a c++ program that creates a thread. the main will display a message “hello world from the main”. the main will create a thread that will display a message “hello world from the thread” and then terminates with a call to pthread_exit()
Answers: 3
question
Computers and Technology, 22.06.2019 22:00
Discuss the ways in which electronic information associated with payments is addressed in terms of security. include encryption, secure sockets layers, and secure electronic transactions in your discussion. are there any other ways that consumers and businesses can keep their payment information secure in an electronic commerce environment? do you feel that your information is safe when conducting electronic business? why or why not?
Answers: 1
question
Computers and Technology, 23.06.2019 05:00
In cell b18, enter a formula to calculate the amount budgeted for meals. this amount is based on the daily meal allowance and the total travel days (# of nights+1).
Answers: 1
question
Computers and Technology, 23.06.2019 10:50
Your friend kayla is starting her own business and asks you whether she should set it up as a p2p network or as a client-server network. list three questions you might ask to kayla decide which network to use and how her answers to those questions would affect your recommendation.
Answers: 2
You know the right answer?
/** * Write a description of class unique here. * * @author Qi Zhu * @version (a version number or a...
Questions
question
Mathematics, 13.07.2019 17:00
Questions on the website: 13722363