Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

import java.io.*; import java.util.*; public class ReadFactors { public static v

ID: 3613516 • Letter: I

Question

import java.io.*;

import java.util.*;

publicclass ReadFactors

{

publicstatic voidmain(String[] args)

{

File factors =new File("Factor List");

int filefac;

int counter=1;

int i=1;

try

{

Scanner scanner =new Scanner(factors);

while(scanner.hasNextInt())

{

filefac =scanner.nextInt();

for(i=2;i< filefac; i++)

{

while(filefac%i==0)

{

int factor=i;

System.out.println("Case #"+counter+": "+filefac+

" has these factors: " +factor);

}

}

{

}

counter++;

}

}

catch(FileNotFoundException e)

{

System.out.println("File not found");

}

}

}

Explanation / Answer

please rate - thanks all I did was change while to if import java.io.*; import java.util.*; public class untitled { public static void main(String[] args) { File factors = new File("Factor List"); int filefac; int counter=1; int i=1; try { Scanner scanner = new Scanner(factors); while(scanner.hasNextInt()) { filefac = scanner.nextInt(); for(i=2;i