View Single Post
Old 02-05-2005, 11:57 AM   #5 (permalink)
merkerguitars
Buffering.........
 
merkerguitars's Avatar
 
Location: Wisconsin...
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 );
 
  }}}
__________________
Donate now! Ask me How!

Please use the search function it is your friend.

Look at my mustang please feel free to comment!

http://www.tfproject.org/tfp/showthread.php?t=26985
merkerguitars is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43