subject

A. Write a method called sieve that takes an integer parameter, n, and returns a Boolean array that indicates, for each number from 0 to n - 1, whether the number is prime (The value should be true if the index is prime and false otherwise) using the sieve of Eratosthenes. For instance if sieve is invoked with n=8, the resulting array will be {false, false, true, true, false, true, false, true}. b. In your main method, Use Scanner to get an integer from the user.
c. Test the sieve method with the user input and display the result appropriately.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 08:00
Two technicians are discussing the common u-joint. technician a says its input and output speeds should be equal. technician b says that it normally has two yokes. which technician is correct?
Answers: 1
question
Computers and Technology, 22.06.2019 10:40
Nims is applicable to all stakeholders with incident related responsibilities. true or false
Answers: 1
question
Computers and Technology, 22.06.2019 11:30
Awell-diversified portfolio needs about 20-25 stocks from different categories.
Answers: 2
question
Computers and Technology, 22.06.2019 18:40
Mariah was working on a multimedia presentation that included both video and audio files. the file was huge, and she wanted to send it to her coworker in another office. she needed to reduce the size of the file so that it could be transmitted faster. the utility she used to do this was
Answers: 2
You know the right answer?
A. Write a method called sieve that takes an integer parameter, n, and returns a Boolean array that...
Questions
question
World Languages, 04.03.2021 03:10
question
Mathematics, 04.03.2021 03:10
question
Mathematics, 04.03.2021 03:10
question
Mathematics, 04.03.2021 03:10
question
English, 04.03.2021 03:10
Questions on the website: 13722363