commit 3b8036a686dff60201a45c99f4d81a4a85930fe8 Author: MooWantFree Date: Fri Dec 12 16:05:47 2025 +0800 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..480bdf5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,39 @@ +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ +.kotlin + +### IntelliJ IDEA ### +.idea/modules.xml +.idea/jarRepositories.xml +.idea/compiler.xml +.idea/libraries/ +*.iws +*.iml +*.ipr + +### Eclipse ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ + +### Mac OS ### +.DS_Store \ No newline at end of file diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..aa00ffa --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..4baf0b3 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,20 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..e122dea --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..c91748a --- /dev/null +++ b/pom.xml @@ -0,0 +1,26 @@ + + + 4.0.0 + + org.example + untitled + 1.0-SNAPSHOT + + + 23 + 23 + UTF-8 + + + + + org.junit.jupiter + junit-jupiter + 5.10.1 + test + + + + \ No newline at end of file diff --git a/src/main/java/Grade.java b/src/main/java/Grade.java new file mode 100644 index 0000000..6148110 --- /dev/null +++ b/src/main/java/Grade.java @@ -0,0 +1,13 @@ +public class Grade { + public static char getLetterGrade(int mark) { + if (mark >= 75) { + return 'A'; + } else if (mark >= 60) { + return 'B'; + } else if (mark > 50) { + return 'C'; + } else { + return 'F'; + } + } +} \ No newline at end of file diff --git a/src/main/java/main.java b/src/main/java/main.java new file mode 100644 index 0000000..8131714 --- /dev/null +++ b/src/main/java/main.java @@ -0,0 +1,5 @@ +class Main { + public static void main(String[] args) { + System.out.println("Hello World"); + } +} diff --git a/src/test/java/GradeTest.java b/src/test/java/GradeTest.java new file mode 100644 index 0000000..dd977f5 --- /dev/null +++ b/src/test/java/GradeTest.java @@ -0,0 +1,16 @@ +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; + +public class GradeTest { + + @Test + public void testGetLetterGrade_With72() { + assertEquals('B', Grade.getLetterGrade(72)); + } + + @Test + public void testGetLetterGrade_FailCase() { + assertEquals('C', Grade.getLetterGrade(50)); + } + +}