QUESTION 21
In the following onOptionsItemSelected() method, which id is
most likely associated with accessing the application’s help
page?
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.item1:
new();
return true;
case R.id.item2:
open();
return true;
case R.id.item3:
close();
return true;
case R.id.item4:
info();
return true;
default:
return
super.onOptionsItemSelected(item);
}
}
item1 |
||
item2 |
||
item4 |
||
none, it will be handled by the default case |
2 points
QUESTION 22
In the following onOptionsItemSelected() method, which id is
most likely associated with starting a new session?
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.item1:
new();
return true;
case R.id.item2:
open();
return true;
case R.id.item3:
close();
return true;
case R.id.item4:
info();
return true;
default:
return
super.onOptionsItemSelected(item);
}
}
item1 |
||
item2 |
||
item4 |
||
none, it will be handled by the default case |
2 points
QUESTION 23
Which of the following components does the Where’s My Phone? app use while waiting for a text message in the background?
Activities |
||
Services |
||
Broadcast Receivers |
||
Content Providers |
2 points
QUESTION 24
What is the text displayed on the canvas after the execution of
the following code?
0 super.onDraw(canvas);
1 Paint dotPaint = new Paint();
2 dotPaint.setColor(Color.RED);
3 canvas.drawRect(dotX, dotY, dotX + 20, dotY +
20,
dotPaint);
4 a = 1;
5 b = 2;
6 a = b;
7 b = a;
8 canvas.drawText(“a: “+a+“| b: “+b, 20, 20, dotPaint);
a: 1|b: 1 |
||
a: 2|b: 1 |
||
a: 1|b: 2 |
||
a: 2|b: 2 |
2 points
QUESTION 25
Which is the correct definition of the term refactoring?
Reducing a trinomial to a set of binomials |
||
Rewriting code to make it better without changing its behavior |
||
Rewriting code to add forgotten functionality or to remove unnecessary functionality |
||
Rewriting code to fix broken functionality |
2 points
QUESTION 26
What does XML stand for?
Extendable Markup Language |
||
Extensible Markup Language |
||
Extended Markup Language |
||
Extra Markup Language |
2 points
QUESTION 27
Which of following is the correct term for a piece of information used to activate an Activity, Service, or Broadcast Receiver?
Intent |
||
IntentFilter |
||
Content Provider |
||
Bundle |
2 points
QUESTION 28
Provided you know the namespace and attribute information, it is easier to manually code the menu’s XML code than it is to use the IDE to generate the menu’s XML code.
True
False
2 points
QUESTION 29
One feature of the Eclipse editor is showing or hiding blocks of code, which makes it easier to scroll through source code. Which of the following is the correct name for this in Eclipse?
Code folding |
||
Section hiding |
||
Expand/Collapse |
||
Open/close |
2 points
QUESTION 30
Which interface should be used to handle the button press event?
OnPressListener |
||
OnClickListener |
||
pressListener |
||
clickListener |
21.
In the given onOptionsItemSelected() method , item4 is most likely to be associated with accessing the application’s help page because it executes a function called info() which is most likely to open a page to provide information about the application, which should be the help page of the application.
22.
In the given onOptionsItemSelected() method , item1 is most likely to be associated with starting a new session because it executes a function called new() which is most likely to open a new a session.
23.
Where’s My Phone? app uses Broadcast Receivers while waiting for a text message in the background. An broadcast receiver is an Android component which allows us to register for system or application events. so the app can use Broadcast receiver to listen for incoming message in the background.
24.
0 super.onDraw(canvas);
1 Paint dotPaint = new Paint();
2 dotPaint.setColor(Color.RED);
3 canvas.drawRect(dotX, dotY, dotX + 20, dotY +
20,
dotPaint);
// draw a rectangle
4 a = 1; // set a=1
5 b = 2; // set b=2
6 a = b; // a=b = 2
7 b = a; // b=a=2
8 canvas.drawText(“a: “+a+“| b: “+b, 20, 20, dotPaint); // a=2 |
b=2
a: 2|b: 2 will be displayed on the canvas after the execution of the above code
25.
Refactoring means rewriting code to make it better without changing its behavior. Refactoring means altering the structure of a program without impacting its functionality.
26.
XML stands for Extensible Markup Language
QUESTION 21 In the following onOptionsItemSelected() method, which id is most likely associated with accessing the...
Mobile Application Development questions Match the component type to the example of that component type. - A. B. C. D. E. F. G. A Tip Calculator - A. B. C. D. E. F. G. Where’s My App, which waits for a text message to be received...
QUESTION 13 A constructor is the same as any other method definition EXCEPT for what? A constructor includes an optional argument list. A constructor includes an optional access modifier, usually public. A constructor includes a return type. A constructor places arguments within parentheses (). 2 points QUESTION 14 Using the asterisk wildcard (e.g. import com.packageName.*) will include all of the classes within packageName, even if they aren’t used. True False 2 points QUESTION 15 The Random class gives...
QUESTION 11 Which of the following could never be found in the file NewClass.java? public NewClass() { message = “Hello World!”; } public String title = “New Class”; public void doSomething() { doSomethingElse(); } public OtherClass() { message = “Hello, World! Good to see you again!”; } 2 points QUESTION 12 Match the terms to the corresponding definition below. - A. B. C. D. E. ...
QUESTION 13 Which of the following is most likely characterized as a low-risk hybrid fund? a. Invests in investment grade bonds and large company equities with brand name product lines. b. Invests in combination of money market securities and shorter-term bonds. c. Invests in equity securities that have low levels of systematic risk. d. Invests in bonds with low interest rate risk and low default risk. QUESTION 14 The Hound Dog Growth Mutual Fund is a highly sought-after investment that...
1. (TCO 7) Which of the following statements are true? (Points : 5) Interfaces contain one and only one implemented method, a constructor. Interfaces are defined inside an abstract class. All methods defined in an interface must be implemented when used by another class. A true object-oriented design must contain as least one interface. Question 2. 2. (TCO 7) In an object-oriented program, methods with no implementation might be found in an _____ and/or a(n) ______....
Question 21. Which of the following would be most likely to increase the demand for jelly? Select one: a. An increase in income; jelly is a normal good. b. An increase in the price of peanut butter, which is often used with jelly. c. Medical research that finds that daily consumption of jelly makes people live 10 years less, on average. d. The price of jelly falls. Question 22. Which one of the following is Demand elasticity when the quantity...
Question 1 (4 points) ✓ Saved Which of the following statements is true? Bitcoin is a distributed and decentralized ledger that records and verifies transactions and ownership, and makes it difficult to tamper with, or shut down. Blockchain is a digital asset where a secure form of cryptography is used to handle transactions, control the creation of additional units, and verify the transfer of assets. There is no single blockchain software used by all -- e.g., Bitcoin has its own...
3 points) Question Three Consider the context-free grammar S >SS+1 SS 1a and the string aa Give a leftmost derivation for the string. 3 points) (4 poiots) (5 points) (3 points) sECTION IWOLAttcmpt.any 3.(or 2) questions from this.scction Suppose we have two tokens: (1) the keyword if, and (2) id-entifiers, which are strings of letters other than if. Show the DFA for these tokens. Give a nightmost derivation for the string. Give a parse tree for the string i) Is...
Question 1 2 pts The preprocessor executes after the compiler. False True Question 2 2 pts What code is human-readable and follows the standards of a programming language? Secret code Source code Key code None of these Machine code Question 3 2 pts What is the symbol that marks the beginning of a one line comment? Question 1 2 pts The preprocessor executes after the compiler. True False Question 5 2 pts A statement that may be used to stop...
IVOVI U UL Question 46 Suppose we have Random rand = new Random(); Which of the following expression generates a random integer between 20 and 100, inclusive? rand.nextint() 96 80 rand.nextint() 96 80 + 20 rand.nextInt() % 81 rand.nextInt() % 81 + 20 A Moving to another question will save this response. Moving to another question will save this response. Question 47 Suppose I have the following Scanner object: File file = new File("data txt") Scanner input = new Scanner(file);...