this is what I have so far.......but i do get an error "'else' without 'if' at line 41 (41:9)"
Code:
package a1;
/**
* <p>Title: Assignment 1</p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2005</p>
* <p>Company: UWRF</p>
* @author Eric Merker
* @version 1.0
*/
import java.io.*;
public class Assignment1 {
public Assignment1() {
}
// add throws IOException so an error doesn't occur
public static void main(String[] args) throws IOException {
String userInput;
int N;
int factor;
BufferedReader br;
br = new BufferedReader(new InputStreamReader(System.in));
System.out.print("What number would you like to enter? ");
userInput = br.readLine();
N = Integer.parseInt(userInput);
boolean noFactorFound;
for (N=2; N <= upperBound; N=++1);{
factor = 2;
noFactorFound = true;
While(factor <= N / 2 && noFactorFound);
{
if (N % factor == 0);
{
noFactorFound = false;
}
else {
factor++;
if (no FactorFound) {
}
}
}
system.out.println ( factor );
}}}