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

ملء الشاشة (f)
exit full mode
سؤال
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
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
Java variable names are case sensitive.
سؤال
You can use int and long data types to store floating point values.
سؤال
What is the on-screen keyboard called?

A) electronic keyboard
B) screenboard
C) soft keyboard
D) touchkey
سؤال
Good graphic design communicates simplicity.
سؤال
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
سؤال
The aim of requesting input from the user is to ensure that every user experience is the same every time the app is used.
سؤال
You should always declare variables in an Android application at the end of the Activity.
سؤال
It is possible to add a predefined system theme or a customized theme of your own design.
سؤال
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
سؤال
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
سؤال
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
سؤال
An application with an appealing graphical design is preferred over applications that are textual in nature.
سؤال
Which kind of variable can be initialized only once?

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

A) abstract
B) hint
C) lead-in
D) prompt
سؤال
The String type is a class, not a primitive data type.
سؤال
The default value for a boolean variable is True.
سؤال
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
سؤال
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
سؤال
Plus ( + ) and minus ( - ) have the highest order of precedence in the order of operations.
سؤال
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'
سؤال
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
سؤال
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
سؤال
What method returns the text label from a selected Spinner item?

A) getItem()
B) getSelectedItem()
C) getSpinnerItem()
D) selectedItem()
سؤال
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
سؤال
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("$###,###.##");
سؤال
____________________ are multitouch interactions such as pressing two fingers to pan, rotate, or zoom.
سؤال
Use a _____________ inside a Text Field control to give users guidelines about the input expected i n the control.
سؤال
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()
سؤال
When you select the ____________________ Text Field, Android deactivates the letters on the keyboard. 
سؤال
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()
سؤال
Which data type is NOT a primitive that holds numeric values?

A) byte
B) char
C) int
D) short
سؤال
You add new theme names to the XML code in the _______________ file.
سؤال
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
سؤال
A(n) ____________________ is a style applied to an Activity or an entire application.
سؤال
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
سؤال
Which of the following operators has the highest order of precedence?

A) ()
B) ++
C) %
D) -
سؤال
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
سؤال
To display text in a TextView control, which method should be used?

A) assignText()
B) displayText()
C) setText()
D) showText()
سؤال
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);
سؤال
Write the statement to display the string "It's my birthday!" in a TextView object named whatsToday. ______________________________
سؤال
The property that connects a Spinner control to a list of items is called ____________________.
سؤال
The code needed to declare a variable called costPerTicket and initialize it to the value 79.99 is ____________________.
سؤال
When a plus sign is placed between two strings, it ____________________ the two strings to create a new string value.
سؤال
The code to decrement an integer variable called counter by 1 is as follows: ____________________.
سؤال
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.
سؤال
The Parse type to extract a double from a String is ____________________.
سؤال
A Spinner control displays a prompt with a list of strings, called ____________________, in a pop-up window.
سؤال
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: ____________________.
سؤال
The code necessary to find an EditText by the name of txtTickets is as follows: ____________________.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/50
auto play flashcards
العب
simple tutorial
ملء الشاشة (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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
5
Good graphic design communicates simplicity.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
8
You should always declare variables in an Android application at the end of the Activity.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
9
It is possible to add a predefined system theme or a customized theme of your own design.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
13
An application with an appealing graphical design is preferred over applications that are textual in nature.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
16
The String type is a class, not a primitive data type.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
17
The default value for a boolean variable is True.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
20
Plus ( + ) and minus ( - ) have the highest order of precedence in the order of operations.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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'
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
24
What method returns the text label from a selected Spinner item?

A) getItem()
B) getSelectedItem()
C) getSpinnerItem()
D) selectedItem()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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("$###,###.##");
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
27
____________________ are multitouch interactions such as pressing two fingers to pan, rotate, or zoom.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
28
Use a _____________ inside a Text Field control to give users guidelines about the input expected i n the control.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
30
When you select the ____________________ Text Field, Android deactivates the letters on the keyboard. 
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
32
Which data type is NOT a primitive that holds numeric values?

A) byte
B) char
C) int
D) short
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
33
You add new theme names to the XML code in the _______________ file.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
35
A(n) ____________________ is a style applied to an Activity or an entire application.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
37
Which of the following operators has the highest order of precedence?

A) ()
B) ++
C) %
D) -
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
39
To display text in a TextView control, which method should be used?

A) assignText()
B) displayText()
C) setText()
D) showText()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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);
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
41
Write the statement to display the string "It's my birthday!" in a TextView object named whatsToday. ______________________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
42
The property that connects a Spinner control to a list of items is called ____________________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
43
The code needed to declare a variable called costPerTicket and initialize it to the value 79.99 is ____________________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
44
When a plus sign is placed between two strings, it ____________________ the two strings to create a new string value.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
45
The code to decrement an integer variable called counter by 1 is as follows: ____________________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
47
The Parse type to extract a double from a String is ____________________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
48
A Spinner control displays a prompt with a list of strings, called ____________________, in a pop-up window.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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: ____________________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
50
The code necessary to find an EditText by the name of txtTickets is as follows: ____________________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.