PrepAway - Latest Free Exam Questions & Answers

Author: seenagape

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 are
a 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.)

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?

Which code segment should you insert at line 06?

An application uses X509 certificates for data encryption and decryption. The application stores
certificates in the Personal certificates collection of the Current User store. On each computer, each
certificate subject is unique.
The application includes a method named LoadCertificate. The LoadCertificate() method includes the
following code. (Line numbers are included for reference only.)

The LoadCertificate() method must load only certificates for which the subject exactly matches the
searchValue parameter value.
You need to ensure that the LoadCertificate() method loads the correct certificates.
Which code segment should you insert at line 06?

Which code segment should you insert at line 04?

You are developing code for an application that retrieves information about Microsoft .NET
Framework assemblies.
The following code segment is part of the application (line numbers are included for reference only):

You need to insert code at line 04. The code must load the assembly. Once the assembly is loaded,
the code must be able to read the assembly metadata, but the code must be denied access from
executing code from the assembly.
Which code segment should you insert at line 04?