Initial Commit
This commit is contained in:
6
Java/IsPrime/.classpath
Normal file
6
Java/IsPrime/.classpath
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
17
Java/IsPrime/.project
Normal file
17
Java/IsPrime/.project
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>IsPrime</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
62
Java/IsPrime/.settings/.svn/entries
Normal file
62
Java/IsPrime/.settings/.svn/entries
Normal file
@@ -0,0 +1,62 @@
|
||||
10
|
||||
|
||||
dir
|
||||
180
|
||||
svn+ssh://tcdevsvn1/svn/test/trunk/Examples/IsPrime/.settings
|
||||
svn+ssh://tcdevsvn1/svn/test
|
||||
|
||||
|
||||
|
||||
2010-11-21T15:30:21.130254Z
|
||||
108
|
||||
ricky.barrette
|
||||
|
||||
|
||||
svn:special svn:externals svn:needs-lock
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
9a5aac6f-9f22-4a63-bd53-bef70477a034
|
||||
|
||||
org.eclipse.jdt.core.prefs
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2012-01-22T19:47:00.000000Z
|
||||
d25cfe62b7ff12e295da66a35642af8b
|
||||
2010-11-21T15:30:21.130254Z
|
||||
108
|
||||
ricky.barrette
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
617
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
K 13
|
||||
svn:mime-type
|
||||
V 10
|
||||
text/plain
|
||||
END
|
||||
@@ -0,0 +1,12 @@
|
||||
#Sun Oct 31 20:11:09 EDT 2010
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.6
|
||||
12
Java/IsPrime/.settings/org.eclipse.jdt.core.prefs
Normal file
12
Java/IsPrime/.settings/org.eclipse.jdt.core.prefs
Normal file
@@ -0,0 +1,12 @@
|
||||
#Sun Oct 31 20:11:09 EDT 2010
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.6
|
||||
105
Java/IsPrime/.svn/entries
Normal file
105
Java/IsPrime/.svn/entries
Normal file
@@ -0,0 +1,105 @@
|
||||
10
|
||||
|
||||
dir
|
||||
180
|
||||
svn+ssh://tcdevsvn1/svn/test/trunk/Examples/IsPrime
|
||||
svn+ssh://tcdevsvn1/svn/test
|
||||
|
||||
|
||||
|
||||
2010-11-21T15:33:27.340663Z
|
||||
111
|
||||
ricky.barrette
|
||||
|
||||
|
||||
svn:special svn:externals svn:needs-lock
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
9a5aac6f-9f22-4a63-bd53-bef70477a034
|
||||
|
||||
.classpath
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2012-01-22T19:47:00.000000Z
|
||||
0feefca3562e5167ed8224d805b3b922
|
||||
2010-11-21T15:30:21.130254Z
|
||||
108
|
||||
ricky.barrette
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
295
|
||||
|
||||
.project
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2012-01-22T19:47:00.000000Z
|
||||
3fe9afba4d2403c478ac165804542a88
|
||||
2010-11-21T15:30:21.130254Z
|
||||
108
|
||||
ricky.barrette
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
366
|
||||
|
||||
.settings
|
||||
dir
|
||||
|
||||
bin
|
||||
dir
|
||||
|
||||
src
|
||||
dir
|
||||
|
||||
5
Java/IsPrime/.svn/prop-base/.classpath.svn-base
Normal file
5
Java/IsPrime/.svn/prop-base/.classpath.svn-base
Normal file
@@ -0,0 +1,5 @@
|
||||
K 13
|
||||
svn:mime-type
|
||||
V 10
|
||||
text/plain
|
||||
END
|
||||
5
Java/IsPrime/.svn/prop-base/.project.svn-base
Normal file
5
Java/IsPrime/.svn/prop-base/.project.svn-base
Normal file
@@ -0,0 +1,5 @@
|
||||
K 13
|
||||
svn:mime-type
|
||||
V 10
|
||||
text/plain
|
||||
END
|
||||
6
Java/IsPrime/.svn/text-base/.classpath.svn-base
Normal file
6
Java/IsPrime/.svn/text-base/.classpath.svn-base
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
17
Java/IsPrime/.svn/text-base/.project.svn-base
Normal file
17
Java/IsPrime/.svn/text-base/.project.svn-base
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>IsPrime</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
62
Java/IsPrime/bin/.svn/entries
Normal file
62
Java/IsPrime/bin/.svn/entries
Normal file
@@ -0,0 +1,62 @@
|
||||
10
|
||||
|
||||
dir
|
||||
180
|
||||
svn+ssh://tcdevsvn1/svn/test/trunk/Examples/IsPrime/bin
|
||||
svn+ssh://tcdevsvn1/svn/test
|
||||
|
||||
|
||||
|
||||
2010-11-21T15:30:21.130254Z
|
||||
108
|
||||
ricky.barrette
|
||||
|
||||
|
||||
svn:special svn:externals svn:needs-lock
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
9a5aac6f-9f22-4a63-bd53-bef70477a034
|
||||
|
||||
IsPrime.class
|
||||
file
|
||||
|
||||
|
||||
|
||||
delete
|
||||
2012-01-22T19:47:00.000000Z
|
||||
e79e996b5b85364052888227f589016a
|
||||
2010-11-21T15:30:21.130254Z
|
||||
108
|
||||
ricky.barrette
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
1518
|
||||
|
||||
5
Java/IsPrime/bin/.svn/prop-base/IsPrime.class.svn-base
Normal file
5
Java/IsPrime/bin/.svn/prop-base/IsPrime.class.svn-base
Normal file
@@ -0,0 +1,5 @@
|
||||
K 13
|
||||
svn:mime-type
|
||||
V 24
|
||||
application/octet-stream
|
||||
END
|
||||
BIN
Java/IsPrime/bin/.svn/text-base/IsPrime.class.svn-base
Normal file
BIN
Java/IsPrime/bin/.svn/text-base/IsPrime.class.svn-base
Normal file
Binary file not shown.
BIN
Java/IsPrime/bin/IsPrime.class
Normal file
BIN
Java/IsPrime/bin/IsPrime.class
Normal file
Binary file not shown.
62
Java/IsPrime/src/.svn/entries
Normal file
62
Java/IsPrime/src/.svn/entries
Normal file
@@ -0,0 +1,62 @@
|
||||
10
|
||||
|
||||
dir
|
||||
180
|
||||
svn+ssh://tcdevsvn1/svn/test/trunk/Examples/IsPrime/src
|
||||
svn+ssh://tcdevsvn1/svn/test
|
||||
|
||||
|
||||
|
||||
2010-11-21T15:30:21.130254Z
|
||||
108
|
||||
ricky.barrette
|
||||
|
||||
|
||||
svn:special svn:externals svn:needs-lock
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
9a5aac6f-9f22-4a63-bd53-bef70477a034
|
||||
|
||||
IsPrime.java
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2012-01-22T19:47:00.000000Z
|
||||
4b8c36f33e4ec6860a8d7dc7c9f9ace5
|
||||
2010-11-21T15:30:21.130254Z
|
||||
108
|
||||
ricky.barrette
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
1252
|
||||
|
||||
5
Java/IsPrime/src/.svn/prop-base/IsPrime.java.svn-base
Normal file
5
Java/IsPrime/src/.svn/prop-base/IsPrime.java.svn-base
Normal file
@@ -0,0 +1,5 @@
|
||||
K 13
|
||||
svn:mime-type
|
||||
V 10
|
||||
text/plain
|
||||
END
|
||||
63
Java/IsPrime/src/.svn/text-base/IsPrime.java.svn-base
Normal file
63
Java/IsPrime/src/.svn/text-base/IsPrime.java.svn-base
Normal file
@@ -0,0 +1,63 @@
|
||||
/**
|
||||
* @author Twenty Codes, LLC
|
||||
* @author ricky barrette
|
||||
* @date Oct 31, 2010
|
||||
*/
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
/**
|
||||
* this is my example class for is prime
|
||||
* @author ricky barrette
|
||||
*/
|
||||
public class IsPrime {
|
||||
|
||||
/*
|
||||
* this is the main method of the class
|
||||
*
|
||||
* @param args from command line
|
||||
*
|
||||
* @author ricky.barrette
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
|
||||
int input = 0;
|
||||
boolean isPrime = true;
|
||||
boolean isNumber;
|
||||
|
||||
/*
|
||||
* we ask the user for input
|
||||
* if they don't enter an int, ask for input again
|
||||
*/
|
||||
do{
|
||||
Scanner scan = new Scanner(System.in);
|
||||
System.out.print("Enter an Integer: ");
|
||||
isNumber = true;
|
||||
try {
|
||||
input = scan.nextInt();
|
||||
} catch (Exception e) {
|
||||
System.out.println("Please try agian");
|
||||
isNumber = false;
|
||||
}
|
||||
}while(! isNumber);
|
||||
|
||||
System.out.println("number, index, mod");
|
||||
|
||||
// process the input
|
||||
for (int i = 2; i < input; i++) {
|
||||
System.out.println(input +", "+ i +", "+ (input % i));
|
||||
if ((input % i) == 0) {
|
||||
isPrime = false;
|
||||
// there is not point of continuing, break the loop (aka stop)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// display the results
|
||||
if (isPrime)
|
||||
System.out.println("The number is prime");
|
||||
else
|
||||
System.out.println("The number is not prime");
|
||||
}
|
||||
|
||||
}
|
||||
63
Java/IsPrime/src/IsPrime.java
Normal file
63
Java/IsPrime/src/IsPrime.java
Normal file
@@ -0,0 +1,63 @@
|
||||
/**
|
||||
* @author Twenty Codes, LLC
|
||||
* @author ricky barrette
|
||||
* @date Oct 31, 2010
|
||||
*/
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
/**
|
||||
* this is my example class for is prime
|
||||
* @author ricky barrette
|
||||
*/
|
||||
public class IsPrime {
|
||||
|
||||
/*
|
||||
* this is the main method of the class
|
||||
*
|
||||
* @param args from command line
|
||||
*
|
||||
* @author ricky.barrette
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
|
||||
int input = 0;
|
||||
boolean isPrime = true;
|
||||
boolean isNumber;
|
||||
|
||||
/*
|
||||
* we ask the user for input
|
||||
* if they don't enter an int, ask for input again
|
||||
*/
|
||||
do{
|
||||
Scanner scan = new Scanner(System.in);
|
||||
System.out.print("Enter an Integer: ");
|
||||
isNumber = true;
|
||||
try {
|
||||
input = scan.nextInt();
|
||||
} catch (Exception e) {
|
||||
System.out.println("Please try agian");
|
||||
isNumber = false;
|
||||
}
|
||||
}while(! isNumber);
|
||||
|
||||
System.out.println("number, index, mod");
|
||||
|
||||
// process the input
|
||||
for (int i = 2; i < input; i++) {
|
||||
System.out.println(input +", "+ i +", "+ (input % i));
|
||||
if ((input % i) == 0) {
|
||||
isPrime = false;
|
||||
// there is not point of continuing, break the loop (aka stop)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// display the results
|
||||
if (isPrime)
|
||||
System.out.println("The number is prime");
|
||||
else
|
||||
System.out.println("The number is not prime");
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user