Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to add two numbers and print the result.
Kotlin
val sum = 5 [1] 3 println(sum)
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using subtraction or multiplication instead of addition.
✗ Incorrect
The + operator adds two numbers together.
2fill in blank
mediumComplete the code to multiply two numbers and print the result.
Kotlin
val product = 7 [1] 4 println(product)
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using addition or division instead of multiplication.
✗ Incorrect
The * operator multiplies two numbers.
3fill in blank
hardFix the error in the code to correctly divide two numbers and print the result.
Kotlin
val result = 10 [1] 2 println(result)
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using multiplication or subtraction instead of division.
✗ Incorrect
The / operator divides the first number by the second.
4fill in blank
hardFill both blanks to calculate the remainder of division and print it.
Kotlin
val remainder = 17 [1] 5 [2] 2 println(remainder)
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using subtraction or multiplication instead of modulo.
Forgetting to add 2 after the modulo operation.
✗ Incorrect
The % operator gives the remainder of division. Adding 2 after that changes the result.
5fill in blank
hardFill all three blanks to compute the expression and print the result.
Kotlin
val result = (8 [1] 3) [2] 2 [3] 4 println(result)
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up the order of operations.
Using wrong operators for each step.
✗ Incorrect
First subtract 3 from 8, then add 2, then multiply by 4.