Added tests

This commit is contained in:
Carlos Galindo 2019-03-27 11:57:47 +01:00
parent 63c312589a
commit 5a1d4b8e8d
Signed by untrusted user who does not match committer: kauron
GPG Key ID: 83E68706DEE119A3
4 changed files with 42 additions and 1 deletions

View File

@ -4,7 +4,6 @@
<contentEntry url="file://$MODULE_DIR$">
<testFolder url="file://$MODULE_DIR$/src/test/java"/>
<testFolder url="file://$MODULE_DIR$/src/test/res"/>
<excludeFolder url="file://$MODULE_DIR$/src/main/java/temporal"/>
<excludeFolder url="file://$MODULE_DIR$/target"/>
</contentEntry>
<lib name="Maven: junit:junit:3.8.1" scope="TEST"/>

View File

@ -0,0 +1,11 @@
public class BasicIf {
public static void main(String[] args) {
boolean isMoving = false;
int currentSpeed = 10;
if (isMoving) {
currentSpeed--;
} else {
System.err.println("The bicycle has already stopped!");
}
}
}

View File

@ -0,0 +1,19 @@
public class BasicIfElse {
public static void main(String[] args) {
int testscore = 76;
char grade;
if (testscore >= 90) {
grade = 'A';
} else if (testscore >= 80) {
grade = 'B';
} else if (testscore >= 70) {
grade = 'C';
} else if (testscore >= 60) {
grade = 'D';
} else {
grade = 'F';
}
System.out.println("Grade = " + grade);
}
}

View File

@ -0,0 +1,12 @@
public class ReturnTest {
public static void main(String[] args) {
int i = Integer.valueOf(args[0]);
if (i == 0) {
System.out.println("true");
return;
} else {
System.out.println("false");
return;
}
}
}