Results 1 to 13 of 13
Thread: Need help with a program!
 06302010, 07:04 PM #1Member
 Join Date
 Jun 2010
 Posts
 8
 Rep Power
 0
 Do you see what I am doing wrong?
 06302010, 07:23 PM #3Member
 Join Date
 Jun 2010
 Posts
 8
 Rep Power
 0
sorry fubarable we have an understanding now
 06302010, 07:59 PM #4
 Join Date
 Sep 2008
 Location
 Voorschoten, the Netherlands
 Posts
 14,126
 Blog Entries
 7
 Rep Power
 24
 06302010, 10:19 PM #5I can't use the % option
What is your algorithm for determining if a number is prime? Not the definition, a list of steps to determine it.
 06302010, 11:07 PM #6Member
 Join Date
 Jun 2010
 Posts
 8
 Rep Power
 0
yes, it is a requirement. the way i will find out if a number has a remainder is to multiply by two times the divisor and subtract that from the number.
 06302010, 11:35 PM #7
So how is the project doing then?
 06302010, 11:50 PM #8Member
 Join Date
 Jun 2010
 Posts
 8
 Rep Power
 0
horribly. man
Last edited by cid; 07012010 at 01:00 PM.
 06302010, 11:53 PM #9
Try debugging your code by printing out each number it tests and show whether that number is prime or not.
 07012010, 01:06 AM #10Member
 Join Date
 Jun 2010
 Posts
 8
 Rep Power
 0
tried debugging
Last edited by cid; 07012010 at 01:00 PM.
 07012010, 01:48 AM #11
Do the following:
Try debugging your code by printing out each number it tests and show whether that number is prime or not.
Where is the answer to this question?
What is your algorithm for determining if a number is prime?
 07012010, 02:10 AM #12Member
 Join Date
 Jun 2010
 Posts
 8
 Rep Power
 0
in order to find out if the number is prime using integers i am subtracting the quotient*divisor from the dividend. if the result is >0 in every instance i am trying to make the program understand that the number is prime and to add it to the sum. if the result of dividendquotient*divisor is 0 then i want the program to skip that number and not add it to the sum.
 07012010, 02:52 AM #13
Similar Threads

changing my program to array working program
By Chewart in forum New To JavaReplies: 39Last Post: 11182009, 07:53 PM 
Execute A program from a Program!
By Moncleared in forum Advanced JavaReplies: 2Last Post: 02222009, 05:17 PM 
Executing a program within a program
By gibsonrocker800 in forum New To JavaReplies: 5Last Post: 05122008, 08:24 AM 
How to execute an External Program through Java program
By Java Tip in forum java.ioReplies: 0Last Post: 04042008, 02:40 PM 
How to execute an External Program through Java program
By JavaBean in forum Java TipReplies: 0Last Post: 10042007, 09:33 PM
Bookmarks