Looks like no one added any tags here yet for you.
True
Boolean type values in Kotlin can only have true or false values
True
False
24
The Float data type in Kotlin can have up to _____ significant bits.
53
24
16
32
for
The ______ control flow statement iterates through anything that provides an iterator.
while
when
for
if
package
What keyword is used to declare a package?
package
pckg
pkg
pack
val
What keyword is used to declare immutable variables (constants) in Kotlin?
var
None of the other choices is correct.
val
dec
True
The when control structure can replace if..else..if chain when used without putting any argument.
True
False
False
Using if statement as an expression requires an else clause. False
True
False
2.5
What is the output of the following code:
2
2.5
Error, data type of variables is not the same
Will not display any output
All the other choices are correct
Which of the following statements will show the output: The value of x is:
All the other choices are correct
Long
What is the data type of the variable declared below: val num = -42L.
Short
Byte
Long
Int
triple quotes
What symbol is used to define a raw string?
a pair of single quotes
three single quotes
a pair of double quotes
triple quotes
True
The if control structure in Kotlin is considered as an expression which means it is expected to return a value.
True
False
Code will execute and will print: 1 2 3 4 6 7 8 9 10
Analyze the code below:
Error in line 2.
Code will execute and will print: 1 2 3 4 5 6 7 8 9 10
Code will execute and will print: 1 2 3 4 6 7 8 9 10
Error in line 3.
plus ( + )
What symbol is used for String concatenation in Kotlin?
period ( . )
plus ( + )
comma ( , )
ampersand ( & )
Code will execute and will print: 1 2 3 4
Analyze the code below:
Code will execute and will print: 1 2 3 4 6 7 8 9 10
Code will execute and will print: 1 2 3 4 5 6 7 8 9 10
Code will execute and will print: 1 2 3 4
Error in line 3.
False
You can use escape characters in a raw string.:
True
False
True
We can put underscores in the initial values of numeric type variables, e.g. val x = 1_234.
True
False
True
The symbol $ is used when creating string templates.
True
False
||, &&, !
Which of the following shows the Kotlin built-in Boolean operations?
||, &&, !!
|, &, !
||, &&, !
|, &, !!
False
The return jump expression terminates the nearest enclosing loop.
True
False
The value is: 7.
Analyze the code below and determine its output:
The value is $7.
The value is: x + 2.
The value is: ${x + 2}.
The value is: 7.
It will execute normally and prints: 6 5 2
What will happen if the code below is executed?
It will execute normally and prints: 6 5 2
Error in line 4, the for statement needs more arguments.
Error in line 2, it is not the correct way of defining arrays.
It will execute normally and prints: 3 9
F or f
To explicitly define a Float type variable, you have to add a suffix ____ after the initial value.
Fl or fl
Float or float
F or f
Ft or ft
The sum is: 13.4
What is the output of the code below?
The sum is: 13
Error, variable x and y does not have the same data type
Error, statements do not have semicolons
The sum is: 13.4
2
What is the output of the code below?
Error, data type of variables is Int
Will not display any output
2.5
2
2,147,483,648 to 2,147,483,647
What is the range value of the Int data type?
2,147,483,648 to 2,147,483,647
-2,147,483,647 to 2,147,483,648
-2,147,483,647 to 2,147,483,647
-2,147,483,648 to 2,147,483,648
$
We can use template expressions in string by using _____ symbol followed by either an identifier or an expression delimited by curly braces.
&
@
^
$
break
What jump expression terminates the nearest enclosing loop?
break
return
goto
continue
Another String
What is the output of the code below?
Will not display any output.
String Another
Another $x
Another String
6
How many numerical data types are there in Kotlin?
6
4
5
3
8
The Byte data type has a size of _____ bits.
16
8
32
4
trimMargin()
What function is used in removing leading whitespaces in a raw string?
trimLead()
trimWhitespace()
trim()
trimMargin()
when
This statement replaced the switch statement in other programming languages.
when
then
choice
select
|First Name: Joseph
|Last Name: Calleja
What is the output of the following code?
Error, the code uses unknown symbols to delimit a string value.
|First Name: Joseph
|Last Name: Calleja
Error, the code uses and unknown function, trimMargin()
First Name: Joseph
Last Name: Calleja
..
When iterating through a range of numbers using the for statement, we use the range expression which is represented by the symbol ________.
“”
..
[ ]
( )
Double
All variables initialized with a fractional number will infer the _____ data type.
Short
Double
Float
Int
It will run and will print: Grade is: Failed
Analyze the following code:
It will run and will print: Grade is: Failed
It will run but there will be no output.
It will not run due to an error in the condition in the if statement.
It will run and will print: Grade is: Passed
True
while and do..while loops are also available in Kotlin and are used the same way they are used in other programming languages.
True
False
False
String is a mutable data type.
True
False
False
Characters are treated as numbers in Kotlin.
True
False
The program will execute, and prints Can now vote.
Analyze the code below:
The program has an error in line 5, !in is not a valid statement.
The program has an error in line 7, keyword else is not used in when statement.
The program will execute, and prints Can now vote.
The program will execute but will not print anything.
True
Using if statement as an expression requires an else clause.
True
False
True
String templates can be used in raw strings.
True
False
False
Individual characters in a Sting-type value can be accessed by indexing operation.
True
False
L or l
If you want to explicitly declare a variable with a Long data type, your have to append a suffix _______ to its initial value.
LNG or lng
L or l
Lng or lng
Long or long
False
Raw strings can contain escape code characters.
True
False
4th
Which of the following codes correctly declares an Int-type array of size 5, initializes the array with values 1, 2, 3, 4, 5 and prints the values vertically?