Question: Homework in Java package labe; import java.util.Scanner Title : b > Lab e :( br Filename : b Sieve0fEratosthenes . java Date Written :/
Homework in Java



package labe; import java.util.Scanner " Title : b > Lab e :( br Filename : b Sieve0fEratosthenes . java Date Written :/ b Specifically , we begin with the first nurtar . p , n the table and and progressively 1. Declare p to be prine , then display it " 2. Cross off all the multiples of that number in the table starting fron 2 * 3. Find the next number in the table after p that is not yet crossed off and ' set p to that number and then repeat steps 1 to 3. * @author Your name and your partner s nane public class SieveofErstosthenes t public static void nain(Stringti args) i //Scanner Object used to get user input from console Scanner scanner - new Scanner(Systen.in); //Prorpt user to enter a number Systen out.print("Enter a nunber:") intn scanner.nextInt(): scanner.close( /Create table of nurbers according to n that user specified int table-new int[n]; yarray nate followed by Jength will eive us size of array, in this case it will be n int arraysize table.length int idx ; int nun -1 /Fill table with numbers while(idx
Due Date :i b epy " cb> Description f b *
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
