How should you complete the relevant code?
HOTSPOT
You are developing a Windows Store app for a handheld device.
The app will modify the content when the user rotates the device to a Portrait Down
orientation.
You need to identify whether the device is in a Portrait Down orientation.
How should you complete the relevant code? (To answer, select the correct code segment
from each drop-down list in the answer area.)
Which code should you use?
Which code segment should you insert at line 03?
You are developing a Windows Store photography app by using JavaScript. The app
includes the following code segment. (Line numbers are included for reference only.)
You need to ensure that the app captures all pictures as landscape-oriented photos at the
maximum resolution.
Which code segment should you insert at line 03?
You are developing a Windows Store app that must meet the following requirements:
DRAG DROP
You are developing a Windows Store app. The app uses hardware devices that are attached
to the computer. The app must meet the following requirements:
• Display a list of currently available hardware devices when the app launches.
• Detect when a hardware device is connected to or removed from the computer.
Develop the solution by selecting and arranging the required code segments in the correct
order. You may not need all of the code segments.
Which signature should you use for each method?
HOTSPOT
You are developing the following classes named:
Class1
Class2
Class3
All of the classes will be part of a single assembly named Assembly.dll. Assembly.dll will be
used by multiple applications.
All of the classes will implement the following interface, which is also part ofAssembly.dll:
<code>
public interface Interface1
{
void Method1(decimal amount);
void Method2(decimal amount);
}
</code>
You need to ensure that the Method2 method for the Class3 class can be executed only
when instances of the class are accessed through the Interface1 interface. The solution
must ensure that calls to the Method1 method can be made either through the interface or
through an instance of the class.
Which signature should you use for each method? (To answer, select the appropriate
signature for each method in the answer area.)
How should you complete the relevant code?
DRAG DROP
You are adding a function to a membership tracking application- The function uses an
integer named memberCode as an input parameter and returns the membership type as a
string.
The function must meet the following requirements:
Return “Non-Member” if the memberCode is 0.
Return “Member” if the memberCode is 1.
Return “Invalid” if the memberCode is any value other than 0 or 1.
You need to implement the function to meet the requirements.
How should you complete the relevant code? (To answer, drag the appropriate statements
to the correct locations in the answer area. Each statement may be used once, more than
once, or not at all. You may need to drag the split bar between panes or scroll to view content.)
How should you complete the relevant code?
DRAG DROP
You are creating a method that will split a single input file into two smaller output files.
The method must perform the following actions:
Create a file named header.dat that contains the first 20 bytes of the input file.
Create a file named body.dat that contains the remainder of the input file.
You need to create the method.
How should you complete the relevant code? (To answer, drag the appropriate code
segments to the correct locations in the answer area. Each code segment may be used
once, more than once, or not at all. You may need to drag the split bar between panes or
scroll to view content.)
How should you complete the relevant code?
HOTSPOT
You are developing a Windows Store app.
The app triggers a background task at specific intervals. The background task must display
an on-screen message when the triggering event occurs.
You need to complete the development of the background task.
How should you complete the relevant code? (To answer, select the correct code segment
from each drop-down list in the answer area.)
which order should you perform the actions?
DRAG DROP
A Microsoft Visual Studio solution contains a Windows Store app project that is written by
using JavaScript code. You add a Windows Runtime Metadata file named Contoso.winmd to
the solution. The WinMD component is written by using C# code.
The Windows Store app must consume the WinMD component.
You need to ensure that IntelliSense can identify the methods of the WinMD component as
soon as possible.
In which order should you perform the actions? To answer, move all actions from the list of
actions to the answer area and arrange them in the correct order.
Which code segment should you use in the method body?
You are implementing a method named ProcessReports that performs a long-running task.
The ProcessReports() method has the following method signature:
public void ProcessReports(List<decimal> values,CancellationTokenSource cts,
CancellationToken ct)
If the calling code requests cancellation, the method must perform the following actions:
Cancel the long-running task.
Set the task status to TaskStatus.Canceled.
You need to ensure that the ProcessReports() method performs the required actions. Which
code segment should you use in the method body?