subject

Aprime number is any integer greater than 1 that’s evenly divisible only by itself and 1. the sieve of eratosthenes is a method of finding prime numbers. it operates as follows: a) create a primitive-type boolean array with all elements initialized to true. array elements with prime indices will remain true. all other array elements will eventually be set to false. b) starting with array index 2, determine whether a given element is true. if so, loop through the remainder of the array and set to false every element whose index is a multiple of the index for the element with value true. then continue the process with the next element with value true. for array index 2, all elements beyond element 2 in the array that have indices which are multiples of 2 (indices 4, 6, 8, 10, etc.) will be set to false; for array index 3, all elements beyond element 3 in the array that have indices which are multiples of 3 (indices 6, 9, 12, 15, etc.) will be set to false; and so on. when this process completes, the array elements that are still true indicate that the index is a prime number. these indices can be displayed. write an application that uses an array of 1,000 elements to determine and display the prime numbers between 2 and 999. ignore array elements 0 and 1.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 09:00
The first screen you see when you open word2016 what is called?
Answers: 1
question
Computers and Technology, 24.06.2019 09:50
Self contained sequences of actions to be performed are? a. expressions b. algorithms c. functions d. formulas
Answers: 1
question
Computers and Technology, 24.06.2019 10:10
Scanning the road can be thought of as a
Answers: 2
question
Computers and Technology, 24.06.2019 16:50
Develop the program incrementally: a) start by reading and displaying each line of the input file to make sure you are reading the data set correctly. b) use the split string method to extract information from each line into a list. print the list to prove that this step is working correctly. d) convert the exam scores to type int and calculate the student’s average. display those items to prove this step is working correctly. e) create a tuple containing the six items for each student (name, exam scores, exam mean). display the tuples to prove this step is working correctly. (optionally, you may want to have the exam scores in a list so your tuple is (name, scores_list, f) append each tuple to a list. display the list to prove this step is working correctly. g) use the sort list method to re-order the tuples in the list. display the list to prove this step is working correctly. h) use a for statement to display the contents of the list as a table (with appropriate formatting). i) use a for statement to calculate the average of all scores on exam #1, then display the results. note that you could have calculated this average within the first loop, but we are explicitly requiring you to do this calculation by looping though your list of tuples. j) add the logic to calculate the average of all scores on exam #2, then display the results.
Answers: 2
You know the right answer?
Aprime number is any integer greater than 1 that’s evenly divisible only by itself and 1. the sieve...
Questions
question
Mathematics, 20.01.2021 16:10
question
History, 20.01.2021 16:10
question
History, 20.01.2021 16:10
Questions on the website: 13722360