update: testing and result finding quest
This commit is contained in:
8
tests/test1.java
Normal file
8
tests/test1.java
Normal file
@@ -0,0 +1,8 @@
|
||||
public class test1 {
|
||||
public static void main(String[] args) {
|
||||
int x = 5; // Line 3
|
||||
int y = x + 2; // Line 4
|
||||
int z = y * 3; // Line 5
|
||||
System.out.println(z); // Line 6
|
||||
}
|
||||
}
|
||||
12
tests/test10.java
Normal file
12
tests/test10.java
Normal file
@@ -0,0 +1,12 @@
|
||||
public class test10{
|
||||
public static void main(String[] args) {
|
||||
int a = 2; // Line 3
|
||||
int b = 3; // Line 4
|
||||
int c = 4; // Line 5
|
||||
int result = (a + b) * c; // Line 6
|
||||
int x = result / 2; // Line 7
|
||||
if (x > 5) { // Line 8
|
||||
System.out.println(x); // Line 9
|
||||
}
|
||||
}
|
||||
}
|
||||
11
tests/test2.java
Normal file
11
tests/test2.java
Normal file
@@ -0,0 +1,11 @@
|
||||
public class test2{
|
||||
public static void main(String[] args) {
|
||||
int x = 10; // Line 3
|
||||
int y = 0; // Line 4
|
||||
if (x > 5) { // Line 5
|
||||
y = x * 2; // Line 6
|
||||
}
|
||||
int z = y + 1; // Line 8
|
||||
System.out.println(z); // Line 9
|
||||
}
|
||||
}
|
||||
10
tests/test3.java
Normal file
10
tests/test3.java
Normal file
@@ -0,0 +1,10 @@
|
||||
public class test3 {
|
||||
public static void main(String[] args) {
|
||||
int sum = 0; // Line 3
|
||||
int i; // Line 4
|
||||
for (i = 0; i < 5; i++) { // Line 5
|
||||
sum = sum + i; // Line 6
|
||||
}
|
||||
System.out.println(sum); // Line 8
|
||||
}
|
||||
}
|
||||
13
tests/test4.java
Normal file
13
tests/test4.java
Normal file
@@ -0,0 +1,13 @@
|
||||
public class test4{
|
||||
public static void main(String[] args) {
|
||||
int x = 10; // Line 3
|
||||
int y = 0; // Line 4
|
||||
if (x > 5) { // Line 5
|
||||
y = x + 10; // Line 6
|
||||
} else {
|
||||
y = x - 10; // Line 8
|
||||
}
|
||||
int z = y * 2; // Line 10
|
||||
System.out.println(z); // Line 11
|
||||
}
|
||||
}
|
||||
9
tests/test5.java
Normal file
9
tests/test5.java
Normal file
@@ -0,0 +1,9 @@
|
||||
public class test5 {
|
||||
public static void main(String[] args) {
|
||||
int a = 5; // Line 3
|
||||
int b = a + 2; // Line 4
|
||||
int c = a * 3; // Line 5
|
||||
int d = b + c; // Line 6
|
||||
System.out.println(d); // Line 7
|
||||
}
|
||||
}
|
||||
13
tests/test6.java
Normal file
13
tests/test6.java
Normal file
@@ -0,0 +1,13 @@
|
||||
public class test6{
|
||||
public static void main(String[] args) {
|
||||
int x = 10; // Line 3
|
||||
int y = 0; // Line 4
|
||||
if (x > 5) { // Line 5
|
||||
if (x > 8) { // Line 6
|
||||
y = x * 2; // Line 7
|
||||
}
|
||||
}
|
||||
int z = y + 1; // Line 10
|
||||
System.out.println(z); // Line 11
|
||||
}
|
||||
}
|
||||
11
tests/test7.java
Normal file
11
tests/test7.java
Normal file
@@ -0,0 +1,11 @@
|
||||
public class test7 {
|
||||
public static void main(String[] args) {
|
||||
int count = 0; // Line 3
|
||||
int sum = 0; // Line 4
|
||||
while (count < 5) { // Line 5
|
||||
sum = sum + count; // Line 6
|
||||
count = count + 1; // Line 7
|
||||
}
|
||||
System.out.println(sum); // Line 9
|
||||
}
|
||||
}
|
||||
10
tests/test8.java
Normal file
10
tests/test8.java
Normal file
@@ -0,0 +1,10 @@
|
||||
public class test8 {
|
||||
public static void main(String[] args) {
|
||||
int x = 5; // Line 3
|
||||
int y = x + 1; // Line 4
|
||||
x = 10; // Line 5
|
||||
int z = x * 2; // Line 6
|
||||
System.out.println(y); // Line 7
|
||||
System.out.println(z); // Line 8
|
||||
}
|
||||
}
|
||||
10
tests/test9.java
Normal file
10
tests/test9.java
Normal file
@@ -0,0 +1,10 @@
|
||||
public class test9{
|
||||
public static void main(String[] args) {
|
||||
int x = 5; // Line 3
|
||||
int y = 10; // Line 4
|
||||
int z = x + 1; // Line 5
|
||||
int w = y + 2; // Line 6
|
||||
System.out.println(z); // Line 7
|
||||
System.out.println(w); // Line 8
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user