1
1
Fork 0

Added empty exercise templates

This commit is contained in:
Svetlana Isakova 2019-10-14 20:36:15 +02:00
parent 8edb31a719
commit 0283939c82
14 changed files with 89 additions and 41 deletions

View File

@ -1,7 +1 @@
package expressionsandStatements2
fun main() {
var x = 1
x = 2
println(x)
}
// type your solution here

View File

@ -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

View File

@ -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
<span class="control">`Debug`</span>.
Notice there's a special shortcut for that:
<span class="shortcut">&shortcut:DebugClass;</span>.
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 <span class="control">`Run | Toggle Line Breakpoint`</span>;
* Press <span class="shortcut">&shortcut:ToggleLineBreakpoint;</span>.
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
<span class="control">`Resume program`</span> on the left of the debug window
or pressing <span class="shortcut">&shortcut:Resume;</span>.
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 <span class="control">`Stop`</span> button to stop
the debugging process.
<div class="hint">
Hints can be added anywhere in task text: type "hint" and press Tab.
</div>

View File

@ -1 +1,9 @@
package expressionsandStatements2
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)
}
}

View File

@ -0,0 +1 @@
// type your solution here

View File

@ -0,0 +1,6 @@
type: edu
files:
- name: src/Task.kt
visible: true
- name: test/Tests.kt
visible: false

View File

@ -0,0 +1,7 @@
This is the markdown document.
Write your task text here
<div class="hint">
Hints can be added anywhere in task text: type "hint" and press Tab.
</div>

View File

@ -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)
}
}

View File

@ -0,0 +1,7 @@
package expressionsandStatements2
fun main() {
var x = 1
x = 2
println(x)
}

View File

@ -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

View File

@ -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
<span class="control">`Debug`</span>.
Notice there's a special shortcut for that:
<span class="shortcut">&shortcut:DebugClass;</span>.
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 <span class="control">`Run | Toggle Line Breakpoint`</span>;
* Press <span class="shortcut">&shortcut:ToggleLineBreakpoint;</span>.
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
<span class="control">`Resume program`</span> on the left of the debug window
or pressing <span class="shortcut">&shortcut:Resume;</span>.
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 <span class="control">`Stop`</span> button to stop
the debugging process.

View File

@ -0,0 +1 @@
package expressionsandStatements2

View File

@ -2,3 +2,5 @@ content:
- Examples
- Exercise 1
- Exercise 2
- Exercise 3
- Exercise 4