Results 1 to 3 of 3
 03172014, 01:46 AM #1Member
 Join Date
 Mar 2014
 Posts
 6
 Rep Power
 0
calculate the factors of a positive integer number
lines 7, 8, &12 "primes" are underline in red (prime cannot be resolved) is what pops up when i hover over the x's.
i don't get why that is.
Java Code:package assignment7; public class Exercise3 { public static void main(String[] args) { Prime.setSize(1000); for (int p = Primes.next(); p < 30; p = Primes.next()) { int n = (int)Math.round(Math.pow(2,p))  1; System.out.printf("%d\t2^%d1%d", p, p, n); if (Primes.isPrime(n)) { System.out.println(" is prime "); } else { System.out.println(" is not prime "); } } } }
Last edited by ATB; 03172014 at 01:49 AM.
 03172014, 01:50 AM #2Senior Member
 Join Date
 Jan 2013
 Location
 Northern Virginia, United States
 Posts
 6,226
 Rep Power
 14
Re: calculate the factors of a positive integer number
What is Prime vs Primes? Perhaps you are missing an import statement. And in the future, please place your code
between [code][/code] tags.
Regards,
JimThe Java^{TM} Tutorials  SSCCE  Java Naming Conventions
Poor planning on your part does not constitute an emergency on my part
 03172014, 01:51 AM #3Senior Member
 Join Date
 Feb 2014
 Posts
 219
 Rep Power
 7
Re: calculate the factors of a positive integer number
Crossposted at calculate the factors of a positive integer number
Similar Threads

Counting positive number inputs and negative number inputs of user. HELP!
By cs3 in forum New To JavaReplies: 1Last Post: 10242012, 12:21 PM 
converting a given positive integer m to a positional number system in base n
By Renxx in forum New To JavaReplies: 2Last Post: 11272011, 05:11 PM 
Greatest Common Factors (Version 2) Storing and Comparing Factors
By skaterboy987 in forum New To JavaReplies: 11Last Post: 11012011, 02:47 AM 
Testing whether a random number is positive
By mamoonrizwan in forum New To JavaReplies: 3Last Post: 05072011, 08:58 AM 
Help with syntax to reverse a positive integer
By sonny in forum New To JavaReplies: 14Last Post: 02272010, 06:19 AM
Bookmarks