From d9978c0c13659c82ff288035474e485f6ee44c14 Mon Sep 17 00:00:00 2001 From: Haidong Ji Date: Sat, 28 Jul 2018 11:54:49 -0500 Subject: Initial commit --- AlgoDesignAndTechniqueEdxJava/.classpath | 12 ++++++++++++ AlgoDesignAndTechniqueEdxJava/.gitignore | 1 + AlgoDesignAndTechniqueEdxJava/.project | 17 +++++++++++++++++ .../.settings/org.eclipse.jdt.core.prefs | 12 ++++++++++++ AlgoDesignAndTechniqueEdxJava/sources/APlusB.java | 18 ++++++++++++++++++ AlgoDesignAndTechniqueEdxJava/tests/APlusBTest.java | 13 +++++++++++++ 6 files changed, 73 insertions(+) create mode 100644 AlgoDesignAndTechniqueEdxJava/.classpath create mode 100644 AlgoDesignAndTechniqueEdxJava/.gitignore create mode 100644 AlgoDesignAndTechniqueEdxJava/.project create mode 100644 AlgoDesignAndTechniqueEdxJava/.settings/org.eclipse.jdt.core.prefs create mode 100644 AlgoDesignAndTechniqueEdxJava/sources/APlusB.java create mode 100644 AlgoDesignAndTechniqueEdxJava/tests/APlusBTest.java diff --git a/AlgoDesignAndTechniqueEdxJava/.classpath b/AlgoDesignAndTechniqueEdxJava/.classpath new file mode 100644 index 0000000..2e7b73a --- /dev/null +++ b/AlgoDesignAndTechniqueEdxJava/.classpath @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/AlgoDesignAndTechniqueEdxJava/.gitignore b/AlgoDesignAndTechniqueEdxJava/.gitignore new file mode 100644 index 0000000..ae3c172 --- /dev/null +++ b/AlgoDesignAndTechniqueEdxJava/.gitignore @@ -0,0 +1 @@ +/bin/ diff --git a/AlgoDesignAndTechniqueEdxJava/.project b/AlgoDesignAndTechniqueEdxJava/.project new file mode 100644 index 0000000..52fd05e --- /dev/null +++ b/AlgoDesignAndTechniqueEdxJava/.project @@ -0,0 +1,17 @@ + + + AlgoDesignAndTechniqueEdxJava + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/AlgoDesignAndTechniqueEdxJava/.settings/org.eclipse.jdt.core.prefs b/AlgoDesignAndTechniqueEdxJava/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..021167a --- /dev/null +++ b/AlgoDesignAndTechniqueEdxJava/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,12 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=9 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=9 +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.release=enabled +org.eclipse.jdt.core.compiler.source=9 diff --git a/AlgoDesignAndTechniqueEdxJava/sources/APlusB.java b/AlgoDesignAndTechniqueEdxJava/sources/APlusB.java new file mode 100644 index 0000000..d0a384a --- /dev/null +++ b/AlgoDesignAndTechniqueEdxJava/sources/APlusB.java @@ -0,0 +1,18 @@ +import java.util.Scanner; +public class APlusB { + + public static int add(int i, int j) { + return i + j; + } + + public static void main(String[] args) { + Scanner s = new Scanner(System.in); + + int a = s.nextInt(); + int b = s.nextInt(); + + System.out.println(add(a,b)); + s.close(); + } + +} diff --git a/AlgoDesignAndTechniqueEdxJava/tests/APlusBTest.java b/AlgoDesignAndTechniqueEdxJava/tests/APlusBTest.java new file mode 100644 index 0000000..868f853 --- /dev/null +++ b/AlgoDesignAndTechniqueEdxJava/tests/APlusBTest.java @@ -0,0 +1,13 @@ + +import static org.junit.jupiter.api.Assertions.*; + +import org.junit.jupiter.api.Test; + +class APlusBTest { + + @Test + void test() { + assertEquals(5, APlusB.add(2,3)); + } + +} -- cgit v1.2.3