Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Google Android Quiz

Total questions: 75

Worksheet time: 38mins

Name
Class
Date
1.

What is the special function name in Kotlin where your code should be written or called from?

(a)  

2.

How should each statement be placed in the code?

(a)  

3.

Which keyword should the closing brace line up with?

(a)  

4.

What should be used to indent code in Kotlin?

(a)  

5.

What is the term used to describe the process of fixing errors in code?

(a)  

6.

What is the appropriate data type for the name of a location in the Google Maps app?

(a)  

7.

What is the appropriate data type for the star rating of a location in the Google Maps app?

(a)  

8.

What is the appropriate data type for the number of reviews of a location in the Google Maps app?

(a)  

9.

What is the appropriate data type for whether the user saved a location in the Google Maps app?

(a)  

10.

What is the appropriate data type for the address of a location in the Google Maps app?

(a)  

11.

What is the assignment operator in Kotlin?

(a)  

12.

What is the correct syntax for a template expression in Kotlin?

(a)  

13.

What is the data type used to store true or false values in Kotlin?

a)

a) String

b)

b) Int

c)

c) Double

d)

d) Boolean

14.

What is the data type used to store text in Kotlin?

a)

a) String

b)

b) Int

c)

c) Double

d)

d) Boolean

15.

What is the data type used to store decimal numbers in Kotlin?

a)

a) String

b)

b) Int

c)

c) Double

d)

d) Boolean

16.

What is the first step in using a function in your code?

a)

Calling the function

b)

Defining the function

c)

Declaring the function

d)

Initializing the function

17.

What is the data type used to store integer numbers in Kotlin?

a)

a) String

b)

b) Int

c)

c) Double

d)

d) Boolean

18.

What does the + symbol do when used with strings in Kotlin?

a)

a) It performs addition of two strings

b)

b) It multiplies two strings

c)

c) It concatenates two strings

d)

d) It compares two strings

19.

What is the value stored in the totalTripLength variable in the given code? val trip1: Double = 3.20 val trip2: Double = 4.10 val trip3: Double = 1.72 val totalTripLength: Double = trip1 + trip2 + trip3

a)

a) 9.02

b)

b) 3.20 + 4.10 + 1.72

c)

c) 0.0

d)

d) 9.0

20.

What is the output of the following code? val nextMeeting = "Next meeting: " val date = "January 1" val reminder = nextMeeting + date

a)

a) Next meeting:January 1

b)

b) Next meeting: January 1

c)

c) Next meeting:

d)

d) January 1

21.

What is a function in programming?

a)

A segment of a program that performs a specific task

b)

A keyword used to define a variable

c)

A data type in Kotlin

d)

A loop structure in programming

22.

How do you use named arguments in a function call?

a)

By including the parameter name followed by an equal sign and then the value

b)

By placing the arguments in parentheses separated by commas

c)

By using the keyword "named" before each argument

d)

By rearranging the order of the arguments

23.

In the Google Maps app, which pieces of data are likely stored as variables?

a)

Name of the location

b)

Star rating of the location

c)

Number of reviews of the location

d)

Address of the location

e)

All of the above

24.

What does it mean to include a parameter name when calling a function?

a)

It is called a named argument

b)

It is required for all function calls

c)

It changes the behavior of the function

d)

It is not allowed in programming languages

25.

How does using named arguments affect the output of a function?

a)

It does not affect the output of the function

b)

It changes the order of the output

c)

It modifies the behavior of the function

d)

It allows you to pass in different values for the parameters

26.

What is the purpose of reordering named arguments in a function call?

a)

To change the behavior of the function

b)

To specify the order of the parameters

c)

To improve the readability of the code

d)

To demonstrate the flexibility of named arguments

27.

What happens if you change the order of the named arguments in a function call?

a)

The function will produce an error

b)

The output of the function will change

c)

The function will ignore the named arguments

d)

The function will use the default values for the parameters

28.

What is Jetpack Compose?

a)

A programming language for Android app development

b)

A suite of libraries for modern Android app development

c)

A tool for building user interfaces in Android apps

d)

A programming framework for building UI components

29.

What does the Unit return type mean?

a)

a) The function returns nothing

b)

b) The function returns an integer

c)

c) The function returns a string

d)

d) The function returns a void type

30.

Which coding convention recommends starting variable names with an uppercase letter?

a)

a) Pascal case

b)

b) Camel case

c)

c) Snake case

d)

d) Kebab case

31.

How are the parameters separated in the function signature?

a)

By a period (.)

b)

By a comma (,)

c)

By a semicolon (;)

d)

By a colon (:)

32.

According to the given data, how should variable names be formatted?

a)

a) All lowercase letters

b)

b) All uppercase letters

c)

c) Start with an uppercase letter

d)

d) Start with a lowercase letter

33.

What is the data type used to store variables with only two possible values in Kotlin?

a)

a) String

b)

b) Int

c)

c) Double

d)

d) Boolean

34.

How are multiple parameters separated in Kotlin functions?

a)

a) By a colon and a space

b)

b) By a comma

c)

c) By a semicolon

d)

d) By a period

35.

What keyword is used to declare a function in Kotlin?

a)

a) fun

b)

b) var

c)

c) val

d)

d) def

36.

What is the purpose of calling a function?

a)

a) To define a function

b)

b) To execute the code within a function

c)

c) To declare a function

d)

d) To print a message

37.

Which function is used to print a message in Kotlin?

a)

a) fun

b)

b) var

c)

c) val

d)

d) println()

38.

Can a function with parameters be called with different arguments?

a)

Yes, it can be called with any value of the same data type

b)

No, it can only be called with the initial argument value

c)

Yes, but only if the arguments are of a different data type

d)

No, parameters restrict the function to a specific argument value

39.

What are the benefits of creating separate functions for specific tasks?

a)

a) Reusable code

b)

b) Improved readability

c)

c) Both a and b

d)

d) None of the above

40.

According to the given data, how should the plus symbol be spaced in a line of code that performs addition?

a)

a) No space before or after the plus symbol

b)

b) Space before the plus symbol but not after

c)

c) Space after the plus symbol but not before

d)

d) Space before and after the plus symbol

41.

What is the default return type if it is not specified in a function declaration?

a)

a) Int

b)

b) String

c)

c) Unit

d)

d) Void

42.

How is the return type specified in a function declaration?

a)

a) By placing a colon (:) after the parentheses

b)

b) By placing a colon (:) before the opening curly brace

c)

c) By placing a colon (:) after the return keyword

d)

d) By placing a colon (:) after the name of a type

43.

What is the benefit of returning a value from a function?

a)

a) It allows you to store the result in a variable

b)

b) It simplifies the function declaration

c)

c) It makes the function more efficient

d)

d) It eliminates the need for the return statement

44.

How do you insert the value of a parameter into a string in Kotlin?

a)

Using the $ symbol followed by the parameter name

b)

Using the @ symbol followed by the parameter name

c)

Using the # symbol followed by the parameter name

d)

Using the ! symbol followed by the parameter name

45.

How do you call the birthdayGreeting() function in the main() function?

a)

a) Call birthdayGreeting()

b)

b) fun birthdayGreeting()

c)

c) println(birthdayGreeting())

d)

d) birthdayGreeting()

46.

What happens if a function returns a value and you call it inside the println() function?

a)

a) The return value is printed directly

b)

b) An error occurs because println() cannot accept a return value

c)

c) The return value is stored in a variable

d)

d) The function is not executed

47.

How do you declare a parameter of type String in Kotlin?

a)

a) Using the syntax name: String

b)

b) Using the syntax String: name

c)

c) Using the syntax String(name)

d)

d) Using the syntax nam

48.

What is the purpose of a return value in a function?

a)

a) To print text

b)

b) To generate data

c)

c) To store a variable

d)

d) To specify the function type

49.

How are parameters declared in Kotlin functions?

a)

a) Within the parentheses after the function name

b)

b) Before the function name

c)

c) After the return statement

d)

d) Within the curly braces of the function body

50.

How do you declare a parameter of type String in Kotlin?

a)

Using the syntax name: String

b)

Using the syntax String: name

c)

Using the syntax String(name)

d)

Using the syntax name(String)

51.

What is the purpose of the \n escape character?

a)

a) To format greetings on a separate line

b)

b) To add a space between greetings

c)

c) To concatenate two strings

d)

d) To escape special characters in a string

52.

What is a parameter in a function?

a)

a) A variable name and data type that can be passed into a function

b)

b) A value that is passed to a function

c)

c) A function that takes in multiple data types

d)

d) A function that returns multiple values

53.

How does Jetpack Compose make it easy to pass data and events between the user interface and other parts of the app?

a)

By using a separate data communication framework

b)

By automatically synchronizing data between the UI and other parts of the app

c)

By using the same language (Kotlin) for both the UI and app logic

d)

By providing built-in data binding capabilities

54.

How should a variable declaration specify the data type?

a)

a) With a space before and after the colon

b)

b) With a space before the colon but not after

c)

c) With a space after the colon but not before

d)

d) Without any space before or after the colon

55.

According to the given data, how should the colon symbol be spaced in a variable declaration?

a)

a) No space before or after the colon

b)

b) Space before the colon but not after

c)

c) Space after the colon but not before

d)

d) Space before and after the colon

56.

How can you move code out of the main() function in Kotlin?

a)

a) By creating a new function

b)

b) By declaring a variable

c)

c) By using the println() function

d)

d) By copying and pasting the code

57.

What is the advantage of using named arguments over positional arguments?

a)

Named arguments are easier to read and understand

b)

Named arguments allow for more flexibility in function calls

c)

Named arguments are faster and more efficient

d)

Named arguments are required for certain types of functions

58.

How do you pass an argument to a function in Kotlin?

a)

By declaring a variable with the argument value

b)

By using the argument keyword

c)

By including the argument within the parentheses when calling the function

d)

By assigning the argument value to the function name

59.

Can you mix named arguments with positional arguments in a function call?

a)

Yes, it is possible to mix named and positional arguments

b)

No, named and positional arguments cannot be used together

c)

Only if the function explicitly allows the use of both types of arguments

d)

It depends on the programming language being used

60.

What language is used to write user interfaces with Jetpack Compose?

a)

Java

b)

C++

c)

Kotlin

d)

Python

61.

According to the given data, where should there be a space in a variable declaration?

a)

a) Before the colon

b)

b) After the colon

c)

c) Before and after the colon

d)

d) There should be no space in a variable declaration

62.

What is the purpose of using named arguments in a function call?

a)

To specify the parameter names when calling a function

b)

To pass arguments in a different order

c)

To include multiple parameters in a function call

d)

To change the output of a function

63.

What is the output of the following code? val nextMeeting = "Next meeting: " val date = "January 1" val reminder = nextMeeting + date + " at work"

a)

a) Next meeting: January 1

b)

b) Next meeting: January 1 at work

c)

c) Next meeting: at work

d)

d) January 1 at work

64.

What is the purpose of adding a parameter to a function?

a)

a) To greet any name that is passed into the function

b)

b) To restrict the function to only greet a specific name

c)

c) To make the function return a different value

d)

d) To make the function accept multiple data types

65.

How can you return multiple values from a function in Kotlin?

a)

a) Using the val keyword

b)

b) Using the return keyword multiple times

c)

c) Using the string formatting syntax

d)

d) Using a return statement with multiple variables

66.

How does Jetpack Compose differ from older View space UI toolkits?

a)

It requires less code to build the UI

b)

It provides more built-in UI components

c)

It is easier to use for beginners

d)

It has better performance and optimization

67.

What is the name of the new function created in the given code?

a)

a) main()

b)

b) birthdayGreeting()

c)

c) println()

d)

d) fun

68.

What is the function signature for the birthdayGreeting() function?

a)

fun birthdayGreeting(name: String, age: Int)

b)

fun birthdayGreeting(name, age)

c)

birthdayGreeting(String name, Int age)

d)

birthdayGreeting(name: String, age: Int)

69.

How does Jetpack Compose handle UI updates when the app data changes?

a)

It automatically re-executes the UI component functions

b)

It updates the UI components directly

c)

It triggers a manual refresh of the UI components

d)

It uses a separate UI update framework

70.

What happens if you include the parameter names in a different order when calling a function?

a)

The function will produce an error

b)

The output of the function will change

c)

The function will ignore the parameter names

d)

The function will use the default values for the parameters

71.

How does Jetpack Compose optimize UI updates?

a)

By skipping any work for elements that haven't changed

b)

By using a separate optimization algorithm

c)

By caching UI component states

d)

By minimizing the number of UI components

72.

What are some features of Jetpack Compose mentioned in the transcript?

a)

Building lists, customizing apps using Teams, adding animation, and testing the UI

b)

Building complex layouts, integrating with external libraries, and managing app state

c)

Creating interactive forms, implementing navigation, and handling user input

d)

Optimizing UI performance, supporting multiple screen sizes, and providing accessibility features

73.

Can you use named arguments with functions that have multiple parameters?

a)

Yes, named arguments can be used with any function

b)

No, named arguments can only be used with functions that have a single parameter

c)

Only if the function explicitly allows the use of named arguments

d)

It depends on the programming language being used

74.

How should operators be spaced in code?

a)

a) There should be no space before or after an operator

b)

b) There should be a space before an operator but not after

c)

c) There should be a space after an operator but not before

d)

d) There should be a space before and after an operator

75.

What is the purpose of the @Composable annotation in Jetpack Compose?

a)

It indicates that the function returns a UI component

b)

It specifies that the function is a layout builder

c)

It marks the function as a UI component

d)

It defines the behavior of the UI component