Deck 3: Engage Android User Input, Variables, and Operations

Full screen (f)
exit full mode
Question
Which kind of TextView can suggest the completion of a word after the first few letters?

A) AutoComplete TextView
B) Alphanumeric TextView
C) Imaging TextView
D) String TextView
Use Space or
up arrow
down arrow
to flip the card.
Question
Java variable names are case sensitive.
Question
You can use int and long data types to store floating point values.
Question
What is the on-screen keyboard called?

A) electronic keyboard
B) screenboard
C) soft keyboard
D) touchkey
Question
Good graphic design communicates simplicity.
Question
Which of the following terms best describes a widget similar to a drop-down list for selecting a single item from a fixed listing?

A) EditText control
B) Message control
C) Spinner control
D) TextView control
Question
The aim of requesting input from the user is to ensure that every user experience is the same every time the app is used.
Question
You should always declare variables in an Android application at the end of the Activity.
Question
It is possible to add a predefined system theme or a customized theme of your own design.
Question
What is used in a Java program to contain data that changes during the execution of the program?

A) constant
B) item
C) literal
D) variable
Question
What defines a string resource of related items in a central location within strings.xml?

A) text table
B) string matrix
C) string array
D) character column
Question
Which term is best defined as a short description of a field that is visible as light-colored text?

A) abstract
B) clue
C) hint
D) synopsis
Question
An application with an appealing graphical design is preferred over applications that are textual in nature.
Question
Which kind of variable can be initialized only once?

A) final variable
B) local variable
C) static variable
D) temporary variable
Question
What can be used to display instructions at the top of Spinner controls?

A) abstract
B) hint
C) lead-in
D) prompt
Question
The String type is a class, not a primitive data type.
Question
The default value for a boolean variable is True.
Question
Which file is a default file that contains commonly used strings for an application?

A) consts.xml
B) data.xml
C) strings.xml
D) values.xml
Question
What term can be described as multitouch interactions such as pressing two fingers to pan, rotate, or zoom?

A) taps
B) gestures
C) actions
D) swipes
Question
Plus ( + ) and minus ( - ) have the highest order of precedence in the order of operations.
Question
What does the R in findViewById(R.id.txtTickets) refer to?

A) the resource folder for the app
B) the resources available to the app
C) a static property of the txtTickets variable
D) a variable named 'R'
Question
To assign a phrase as the value of a String variable, in which of the following characters should the text be placed?

A) brackets
B) double quotation marks
C) parentheses
D) single quotation marks
Question
What keystroke can you use to invoke possible code completion suggestions as you type an XML or Java line of code?

A) Ctrl+space
B) Alt+home
C) Ctrl+end
D) Alt+insert
Question
What method returns the text label from a selected Spinner item?

A) getItem()
B) getSelectedItem()
C) getSpinnerItem()
D) selectedItem()
Question
What Java class should you use if you want to format a number such as 279.55 to display in currency format such as $279.55?

A) DecimalFormat
B) DollarFormat
C) NumericFormat
D) StringFormat
Question
Which statement establishes a currency decimal format so that the variable itemCost is displayed in U.S. dollar format in the following statement? USdollars.format(itemCost));

A) new USdollars = DecimalFormat("$###,###.##");
B) CurrencyFormat USdollars = new CurrencyFormat("$###,###.##");
C) DecimalFormat USdollars = new DecimalFormat("$###,###.##");
D) new USdollars = CurrencyFormat("$###,###.##");
Question
____________________ are multitouch interactions such as pressing two fingers to pan, rotate, or zoom.
Question
Use a _____________ inside a Text Field control to give users guidelines about the input expected i n the control.
Question
What do you use if you want an app to wait for a user to click or tap a button before taking action?

A) onClickListener()
B) onCreate()
C) findViewById()
D) setContentView()
Question
When you select the ____________________ Text Field, Android deactivates the letters on the keyboard. 
Question
Which class should you use if you want to convert the string "123" to the number one hundred and twenty-three?

A) parseInt()
B) strInt()
C) convertStr()
D) convertNum()
Question
Which data type is NOT a primitive that holds numeric values?

A) byte
B) char
C) int
D) short
Question
You add new theme names to the XML code in the _______________ file.
Question
You have a variable that will only assume values between 0 and 100. What would be the most compact primitive type to use?

A) byte
B) float
C) int
D) long
Question
A(n) ____________________ is a style applied to an Activity or an entire application.
Question
What must you do before you can use a variable in a Java application?

A) delcare it
B) check its data type
C) display it
D) store it in the manifest
Question
Which of the following operators has the highest order of precedence?

A) ()
B) ++
C) %
D) -
Question
Which primitive data type should you use if the variable should have only two values and will be used in conditional statements?

A) char
B) byte
C) boolean
D) int
Question
To display text in a TextView control, which method should be used?

A) assignText()
B) displayText()
C) setText()
D) showText()
Question
Choose the option that completes the following code so that the text is displayed in a TextView object named displayText .
String sports = "Football";
String fall = sports + " season begins in the Fall.";
---- code goes here ----

A) displayText.getText(sports+fall);
B) displayText = fall.getText();
C) setText(fall).displayText;
D) displayText.setText(fall);
Question
Write the statement to display the string "It's my birthday!" in a TextView object named whatsToday. ______________________________
Question
The property that connects a Spinner control to a list of items is called ____________________.
Question
The code needed to declare a variable called costPerTicket and initialize it to the value 79.99 is ____________________.
Question
When a plus sign is placed between two strings, it ____________________ the two strings to create a new string value.
Question
The code to decrement an integer variable called counter by 1 is as follows: ____________________.
Question
A Spinner control holds multiple text strings and it is best to use a(n) ________________ that can be referenced from the String Resources in the application.
Question
The Parse type to extract a double from a String is ____________________.
Question
A Spinner control displays a prompt with a list of strings, called ____________________, in a pop-up window.
Question
The code necessary to read a number out of an EditText control called txtNumberOfTickets and convert it to an integer, assigned to the variable numTickets , is as follows: ____________________.
Question
The code necessary to find an EditText by the name of txtTickets is as follows: ____________________.
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/50
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 3: Engage Android User Input, Variables, and Operations
1
Which kind of TextView can suggest the completion of a word after the first few letters?

A) AutoComplete TextView
B) Alphanumeric TextView
C) Imaging TextView
D) String TextView
A
2
Java variable names are case sensitive.
True
3
You can use int and long data types to store floating point values.
False
4
What is the on-screen keyboard called?

A) electronic keyboard
B) screenboard
C) soft keyboard
D) touchkey
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
5
Good graphic design communicates simplicity.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
6
Which of the following terms best describes a widget similar to a drop-down list for selecting a single item from a fixed listing?

A) EditText control
B) Message control
C) Spinner control
D) TextView control
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
7
The aim of requesting input from the user is to ensure that every user experience is the same every time the app is used.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
8
You should always declare variables in an Android application at the end of the Activity.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
9
It is possible to add a predefined system theme or a customized theme of your own design.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
10
What is used in a Java program to contain data that changes during the execution of the program?

A) constant
B) item
C) literal
D) variable
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
11
What defines a string resource of related items in a central location within strings.xml?

A) text table
B) string matrix
C) string array
D) character column
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
12
Which term is best defined as a short description of a field that is visible as light-colored text?

A) abstract
B) clue
C) hint
D) synopsis
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
13
An application with an appealing graphical design is preferred over applications that are textual in nature.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
14
Which kind of variable can be initialized only once?

A) final variable
B) local variable
C) static variable
D) temporary variable
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
15
What can be used to display instructions at the top of Spinner controls?

A) abstract
B) hint
C) lead-in
D) prompt
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
16
The String type is a class, not a primitive data type.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
17
The default value for a boolean variable is True.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
18
Which file is a default file that contains commonly used strings for an application?

A) consts.xml
B) data.xml
C) strings.xml
D) values.xml
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
19
What term can be described as multitouch interactions such as pressing two fingers to pan, rotate, or zoom?

A) taps
B) gestures
C) actions
D) swipes
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
20
Plus ( + ) and minus ( - ) have the highest order of precedence in the order of operations.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
21
What does the R in findViewById(R.id.txtTickets) refer to?

A) the resource folder for the app
B) the resources available to the app
C) a static property of the txtTickets variable
D) a variable named 'R'
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
22
To assign a phrase as the value of a String variable, in which of the following characters should the text be placed?

A) brackets
B) double quotation marks
C) parentheses
D) single quotation marks
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
23
What keystroke can you use to invoke possible code completion suggestions as you type an XML or Java line of code?

A) Ctrl+space
B) Alt+home
C) Ctrl+end
D) Alt+insert
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
24
What method returns the text label from a selected Spinner item?

A) getItem()
B) getSelectedItem()
C) getSpinnerItem()
D) selectedItem()
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
25
What Java class should you use if you want to format a number such as 279.55 to display in currency format such as $279.55?

A) DecimalFormat
B) DollarFormat
C) NumericFormat
D) StringFormat
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
26
Which statement establishes a currency decimal format so that the variable itemCost is displayed in U.S. dollar format in the following statement? USdollars.format(itemCost));

A) new USdollars = DecimalFormat("$###,###.##");
B) CurrencyFormat USdollars = new CurrencyFormat("$###,###.##");
C) DecimalFormat USdollars = new DecimalFormat("$###,###.##");
D) new USdollars = CurrencyFormat("$###,###.##");
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
27
____________________ are multitouch interactions such as pressing two fingers to pan, rotate, or zoom.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
28
Use a _____________ inside a Text Field control to give users guidelines about the input expected i n the control.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
29
What do you use if you want an app to wait for a user to click or tap a button before taking action?

A) onClickListener()
B) onCreate()
C) findViewById()
D) setContentView()
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
30
When you select the ____________________ Text Field, Android deactivates the letters on the keyboard. 
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
31
Which class should you use if you want to convert the string "123" to the number one hundred and twenty-three?

A) parseInt()
B) strInt()
C) convertStr()
D) convertNum()
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
32
Which data type is NOT a primitive that holds numeric values?

A) byte
B) char
C) int
D) short
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
33
You add new theme names to the XML code in the _______________ file.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
34
You have a variable that will only assume values between 0 and 100. What would be the most compact primitive type to use?

A) byte
B) float
C) int
D) long
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
35
A(n) ____________________ is a style applied to an Activity or an entire application.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
36
What must you do before you can use a variable in a Java application?

A) delcare it
B) check its data type
C) display it
D) store it in the manifest
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
37
Which of the following operators has the highest order of precedence?

A) ()
B) ++
C) %
D) -
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
38
Which primitive data type should you use if the variable should have only two values and will be used in conditional statements?

A) char
B) byte
C) boolean
D) int
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
39
To display text in a TextView control, which method should be used?

A) assignText()
B) displayText()
C) setText()
D) showText()
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
40
Choose the option that completes the following code so that the text is displayed in a TextView object named displayText .
String sports = "Football";
String fall = sports + " season begins in the Fall.";
---- code goes here ----

A) displayText.getText(sports+fall);
B) displayText = fall.getText();
C) setText(fall).displayText;
D) displayText.setText(fall);
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
41
Write the statement to display the string "It's my birthday!" in a TextView object named whatsToday. ______________________________
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
42
The property that connects a Spinner control to a list of items is called ____________________.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
43
The code needed to declare a variable called costPerTicket and initialize it to the value 79.99 is ____________________.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
44
When a plus sign is placed between two strings, it ____________________ the two strings to create a new string value.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
45
The code to decrement an integer variable called counter by 1 is as follows: ____________________.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
46
A Spinner control holds multiple text strings and it is best to use a(n) ________________ that can be referenced from the String Resources in the application.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
47
The Parse type to extract a double from a String is ____________________.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
48
A Spinner control displays a prompt with a list of strings, called ____________________, in a pop-up window.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
49
The code necessary to read a number out of an EditText control called txtNumberOfTickets and convert it to an integer, assigned to the variable numTickets , is as follows: ____________________.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
50
The code necessary to find an EditText by the name of txtTickets is as follows: ____________________.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 50 flashcards in this deck.