diff --git a/Programming Basics/Expressions & Statements/Exercise 2/src/Task.kt b/Programming Basics/Expressions & Statements/Exercise 2/src/Task.kt index e6c4c332..0a41ef65 100644 --- a/Programming Basics/Expressions & Statements/Exercise 2/src/Task.kt +++ b/Programming Basics/Expressions & Statements/Exercise 2/src/Task.kt @@ -1,7 +1 @@ -package expressionsandStatements2 - -fun main() { - var x = 1 - x = 2 - println(x) -} \ No newline at end of file +// type your solution here \ No newline at end of file diff --git a/Programming Basics/Expressions & Statements/Exercise 2/task-info.yaml b/Programming Basics/Expressions & Statements/Exercise 2/task-info.yaml index 6c0a440f..7ad1b827 100644 --- a/Programming Basics/Expressions & Statements/Exercise 2/task-info.yaml +++ b/Programming Basics/Expressions & Statements/Exercise 2/task-info.yaml @@ -1,8 +1,6 @@ -type: ide +type: edu files: - name: src/Task.kt visible: true - name: test/Tests.kt visible: false -feedback_link: | - https://docs.google.com/forms/d/e/1FAIpQLSdkaliSwYkjiV21bZl0yP-In2g5p17sAQCfaGjyHx_QYMWTiQ/viewform?usp=pp_url&entry.189755027=Programming+Basics+%2F+Expressions+%26+Statements+%2F+Exercise2 diff --git a/Programming Basics/Expressions & Statements/Exercise 2/task.md b/Programming Basics/Expressions & Statements/Exercise 2/task.md index df935c86..5da84191 100644 --- a/Programming Basics/Expressions & Statements/Exercise 2/task.md +++ b/Programming Basics/Expressions & Statements/Exercise 2/task.md @@ -1,32 +1,7 @@ -## Mastering the IDE: Debug +This is the markdown document. -Debugging is a powerful way to discover what's happening in your code. You can -observe intermediate states of the program and changes between these states. +Write your task text here -Click on the icon next to the `main()` function and choose -`Debug`. -Notice there's a special shortcut for that: -&shortcut:DebugClass;. -The program just runs and displays the result, -because you haven't set any points where the execution should be paused. - -The points where you want to pause the execution to observe the state -of the variables are called *breakpoints*. -To create line breakpoints in the editor first place the caret -on the desired line of the source code. -Then do one of the following: -* Click the left gutter area at a line where you want to toggle a breakpoint; -* On the main menu, choose `Run | Toggle Line Breakpoint`; -* Press &shortcut:ToggleLineBreakpoint;. - -Set breakpoints on lines 4 and 5. Then begin debugging the program again and -notice how it stops at the first breakpoint. The debug window below the screen -shows you the values of all the variables. Continue the process by clicking on -`Resume program` on the left of the debug window -or pressing &shortcut:Resume;. -Notice how the value of the variable `x` changes after the assignment. - -To stop the debugging process you can either finish the program and see -the result or stop in explicitly. -Press the `Stop` button to stop -the debugging process. \ No newline at end of file +
+ Hints can be added anywhere in task text: type "hint" and press Tab. +
\ No newline at end of file diff --git a/Programming Basics/Expressions & Statements/Exercise 2/test/Tests.kt b/Programming Basics/Expressions & Statements/Exercise 2/test/Tests.kt index 1c921514..8ef4aa3b 100644 --- a/Programming Basics/Expressions & Statements/Exercise 2/test/Tests.kt +++ b/Programming Basics/Expressions & Statements/Exercise 2/test/Tests.kt @@ -1 +1,9 @@ -package expressionsandStatements2 \ No newline at end of file +import org.junit.Assert +import org.junit.Test + +class Test { + @Test fun testSolution() { + //TODO: implement your test here + Assert.assertTrue("Tests not implemented for the task", false) + } +} \ No newline at end of file diff --git a/Programming Basics/Expressions & Statements/Exercise 3/src/Task.kt b/Programming Basics/Expressions & Statements/Exercise 3/src/Task.kt new file mode 100644 index 00000000..0a41ef65 --- /dev/null +++ b/Programming Basics/Expressions & Statements/Exercise 3/src/Task.kt @@ -0,0 +1 @@ +// type your solution here \ No newline at end of file diff --git a/Programming Basics/Expressions & Statements/Exercise 3/task-info.yaml b/Programming Basics/Expressions & Statements/Exercise 3/task-info.yaml new file mode 100644 index 00000000..7ad1b827 --- /dev/null +++ b/Programming Basics/Expressions & Statements/Exercise 3/task-info.yaml @@ -0,0 +1,6 @@ +type: edu +files: +- name: src/Task.kt + visible: true +- name: test/Tests.kt + visible: false diff --git a/Programming Basics/Expressions & Statements/Exercise 3/task.md b/Programming Basics/Expressions & Statements/Exercise 3/task.md new file mode 100644 index 00000000..5da84191 --- /dev/null +++ b/Programming Basics/Expressions & Statements/Exercise 3/task.md @@ -0,0 +1,7 @@ +This is the markdown document. + +Write your task text here + +
+ Hints can be added anywhere in task text: type "hint" and press Tab. +
\ No newline at end of file diff --git a/Programming Basics/Expressions & Statements/Exercise 3/test/Tests.kt b/Programming Basics/Expressions & Statements/Exercise 3/test/Tests.kt new file mode 100644 index 00000000..8ef4aa3b --- /dev/null +++ b/Programming Basics/Expressions & Statements/Exercise 3/test/Tests.kt @@ -0,0 +1,9 @@ +import org.junit.Assert +import org.junit.Test + +class Test { + @Test fun testSolution() { + //TODO: implement your test here + Assert.assertTrue("Tests not implemented for the task", false) + } +} \ No newline at end of file diff --git a/Programming Basics/Expressions & Statements/Exercise 4/src/Task.kt b/Programming Basics/Expressions & Statements/Exercise 4/src/Task.kt new file mode 100644 index 00000000..e6c4c332 --- /dev/null +++ b/Programming Basics/Expressions & Statements/Exercise 4/src/Task.kt @@ -0,0 +1,7 @@ +package expressionsandStatements2 + +fun main() { + var x = 1 + x = 2 + println(x) +} \ No newline at end of file diff --git a/Programming Basics/Expressions & Statements/Exercise 4/task-info.yaml b/Programming Basics/Expressions & Statements/Exercise 4/task-info.yaml new file mode 100644 index 00000000..6c0a440f --- /dev/null +++ b/Programming Basics/Expressions & Statements/Exercise 4/task-info.yaml @@ -0,0 +1,8 @@ +type: ide +files: +- name: src/Task.kt + visible: true +- name: test/Tests.kt + visible: false +feedback_link: | + https://docs.google.com/forms/d/e/1FAIpQLSdkaliSwYkjiV21bZl0yP-In2g5p17sAQCfaGjyHx_QYMWTiQ/viewform?usp=pp_url&entry.189755027=Programming+Basics+%2F+Expressions+%26+Statements+%2F+Exercise2 diff --git a/Programming Basics/Expressions & Statements/Exercise 2/task-remote-info.yaml b/Programming Basics/Expressions & Statements/Exercise 4/task-remote-info.yaml similarity index 100% rename from Programming Basics/Expressions & Statements/Exercise 2/task-remote-info.yaml rename to Programming Basics/Expressions & Statements/Exercise 4/task-remote-info.yaml diff --git a/Programming Basics/Expressions & Statements/Exercise 4/task.md b/Programming Basics/Expressions & Statements/Exercise 4/task.md new file mode 100644 index 00000000..df935c86 --- /dev/null +++ b/Programming Basics/Expressions & Statements/Exercise 4/task.md @@ -0,0 +1,32 @@ +## Mastering the IDE: Debug + +Debugging is a powerful way to discover what's happening in your code. You can +observe intermediate states of the program and changes between these states. + +Click on the icon next to the `main()` function and choose +`Debug`. +Notice there's a special shortcut for that: +&shortcut:DebugClass;. +The program just runs and displays the result, +because you haven't set any points where the execution should be paused. + +The points where you want to pause the execution to observe the state +of the variables are called *breakpoints*. +To create line breakpoints in the editor first place the caret +on the desired line of the source code. +Then do one of the following: +* Click the left gutter area at a line where you want to toggle a breakpoint; +* On the main menu, choose `Run | Toggle Line Breakpoint`; +* Press &shortcut:ToggleLineBreakpoint;. + +Set breakpoints on lines 4 and 5. Then begin debugging the program again and +notice how it stops at the first breakpoint. The debug window below the screen +shows you the values of all the variables. Continue the process by clicking on +`Resume program` on the left of the debug window +or pressing &shortcut:Resume;. +Notice how the value of the variable `x` changes after the assignment. + +To stop the debugging process you can either finish the program and see +the result or stop in explicitly. +Press the `Stop` button to stop +the debugging process. \ No newline at end of file diff --git a/Programming Basics/Expressions & Statements/Exercise 4/test/Tests.kt b/Programming Basics/Expressions & Statements/Exercise 4/test/Tests.kt new file mode 100644 index 00000000..1c921514 --- /dev/null +++ b/Programming Basics/Expressions & Statements/Exercise 4/test/Tests.kt @@ -0,0 +1 @@ +package expressionsandStatements2 \ No newline at end of file diff --git a/Programming Basics/Expressions & Statements/lesson-info.yaml b/Programming Basics/Expressions & Statements/lesson-info.yaml index e1fd90d3..19662b24 100644 --- a/Programming Basics/Expressions & Statements/lesson-info.yaml +++ b/Programming Basics/Expressions & Statements/lesson-info.yaml @@ -2,3 +2,5 @@ content: - Examples - Exercise 1 - Exercise 2 +- Exercise 3 +- Exercise 4