Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to print the Android market share percentage.
Android Kotlin
val marketShare = 72.2 println("Android market share is $[1]%")
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes around the variable name prints the name, not the value.
Using an undefined variable name causes an error.
✗ Incorrect
Use the variable marketShare to print the actual value, not a string literal.
2fill in blank
mediumComplete the code to create a list of Android advantages.
Android Kotlin
val advantages = listOf("Open Source", [1], "Wide Device Range")
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting quotes around string elements.
Using invalid variable names instead of strings.
✗ Incorrect
List elements must be strings with quotes.
3fill in blank
hardFix the error in the code that checks if Android is dominant.
Android Kotlin
val marketShare = 72.2 val isDominant = marketShare [1] 50 println("Is Android dominant? $isDominant")
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '=' instead of '==' or comparison operators.
Using '<' which checks the opposite condition.
✗ Incorrect
Use '>' to check if marketShare is greater than 50.
4fill in blank
hardFill both blanks to create a map of Android features and their benefits.
Android Kotlin
val features = mapOf("Open Source" to [1], "Customizable" to [2])
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up benefits with negative words.
Using incorrect syntax for mapOf values.
✗ Incorrect
Open Source means free to use; Customizable means flexible UI.
5fill in blank
hardFill all three blanks to filter Android devices with screen size over 6 inches.
Android Kotlin
val devices = listOf(5.5, 6.1, 6.5, 5.8) val largeScreens = devices.filter { it [1] [2] } // inches println("Large screens: $[3]")
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' instead of '>' for filtering.
Printing the wrong variable name.
✗ Incorrect
Filter devices where size > 6 and print the filtered list.