Home » [Free] Get all latest Microsoft 70-483 Actual Tests 171-180

[Free] Get all latest Microsoft 70-483 Actual Tests 171-180

Ensurepass

QUESTION 171

You are developing an application that uses several objects. The application includes the following code segment. (Line numbers are included for reference only.)

 

clip_image001

 

You need to evaluate whether an object is null.

 

Which code segment should you insert at line 03?

 

clip_image002

 

A.

Option A

B.

Option B

C.

Option C

D.

Option D

 

Correct Answer: B

Explanation:

Use the == operator to compare values and in this case also use the null literal.

 

 

QUESTION 172

You are implementing a new method named ProcessData. The ProcessData() method calls a third-party component that performs a long-running operation to retrieve stock information from a web service.

 

The third-party component uses the IAsyncResult pattern to signal completion of the long- running operation so that the UI can be updated with the new values.

 

You need to ensure that the calling code handles the long-running operation as a System.Threading.Tasks.Task object to avoid blocking the UI thread.

 

Which two actions should you perform? (Each correct answer presents part of the solution.

Choose two.)

 

A.

Create a TaskCompletionSource<T> object.

B.

Call the component by using the TaskFactory.FromAsync() method.

C.

Apply the following attribute to the ProcessData() method signature:

[Methodlmpl(MethodlmplOptions.Synchronized)]

D.

Apply the async modifier to the ProcessData() method signature.

 

Correct Answer: AB

Explanation:

A: In many scenarios, it is useful to enable a Task<TResult> to represent an external asynchronous operation. TaskCompletionSource<TResult> is provided for this purpose. It enables the creation of a task that can be handed out to consumers, and those consumers can use the members of the task as they would any other. However, unlike most tasks, the state of a task created by a TaskCompletionSource is controlled explicitly by the methods on TaskCompletionSource. This enables the completion of the external asynchronous operation to be propagated to the underlying Task. The separation also ensures that consumers are not able to transition the state without access to the corresponding TaskCompletionSource.

 

B: TaskFactory.FromAsync Method

Creates a Task that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. Overloaded.

 

Example:

TaskFactory.FromAsync Method (IAsyncResult, Action<IAsyncResult>) Creates a Task that executes an end method action when a specified IAsyncResult completes.

 

Note:

* System.Threading.Tasks.Task

Represents an asynchronous operation.

 

 

QUESTION 173

You are developing a class named Account that will be used by several applications. The applications that will consume the Account class will make asynchronous calls to the Account class to execute several different methods. You need to ensure that only one call to the methods is executed at a time. Which keyword should you use?

 

A.

sealed

B.

protected

C.

checked

D.

lock

 

Correct Answer: D

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

QUESTION 174

You are developing an application by using C#. The application will write events to an event log. You plan to deploy the application to a server. You create an event source named MySource and a custom log named MyLog on the server. You need to write events to the custom log. Which code segment should you use?

 

clip_image004

 

A.

Option A

B.

Option B

C.

Option C

D.

Option D

 

Correct Answer: D

 

 

QUESTION 175

You plan to store passwords in a Windows Azure SQL Database database. You need to ensure that the passwords are stored in the database by using a hash algorithm. Which cryptographic algorithm should you use?

 

A.

ECDSA

B.

RSA-768

C.

AES-256

D.

SHA-256

 

Correct Answer: D

 

 

 

 

 

 

 

 

QUESTION 176

HOTSPOT

You have an existing order processing system that accepts .xml files.

 

The following code shows an example of a properly formatted order in XML:

 

clip_image005

 

You create the following class that will be serialized:

 

clip_image006

 

For each of the following properties, select Yes if the property is serialized according to the defined schema. Otherwise, select No.

 

clip_image007

 

Correct Answer:

clip_image008

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

QUESTION 177

You are developing an application that includes methods named ConvertAmount and TransferFunds.

 

You need to ensure that the precision and range of the value in the amount variable is not lost when the TransferFunds() method is called.

 

Which code segment should you use?

 

clip_image009

 

A.

Option A

B.

Option B

C.

Option C

D.

Option D

 

Correct Answer: C

Explanation:

Simply use float for the TransferFunds parameter.

 

Note:

* The float keyword signifies a simple type that stores 32-bit floating-point values.

* The double keyword signifies a simple type that stores 64-bit floating-point values

 

 

QUESTION 178

You need to write a console application that meets the following requirements:

 

clip_image011If the application is compiled in Debug mode, the console output must display Entering debug mode.

clip_image011[1]If the application is compiled in Release mode, the console output must display Entering release mode.

 

Which code should you use?

 

clip_image012

 

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Correct Answer: B

Explanation:

When the C# compiler encounters an #if directive, followed eventually by an #endif directive, it will compile the code between the directives only if the specified symbol is defined. Unlike C and C++, you cannot assign a numeric value to a symbol; the #if statement in C# is Boolean and only tests whether the symbol has been defined or not. For example,

#define DEBUG

// …

#if DEBUG

Console.WriteLine(“Debug version”);

#endif

 

 

QUESTION 179

DRAG DROP

You are adding a method to an existing application. The method uses an integer named statusCode as an input parameter and returns the status code as a string.

 

The method must meet the following requirements:

 

clip_image011[2]Return “Error” if the statusCode is 0.

clip_image011[3]Return “Success” if the statusCode is 1.

clip_image011[4]Return “Unauthorized” if the statusCode is any value other than 0 or 1.

 

You need to implement the method 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.)

 

clip_image013

 

Correct Answer:

clip_image014

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

QUESTION 180

You have the following class (line numbers are included for reference only):

 

clip_image015

 

ServiceProxy is a proxy for a web service. Calls to the Update method can take up to five seconds. The Test class is the only class the uses Class1.

 

You run the Execute method three times, and you receive the following results:

 

213

 

312

 

231

 

You need to ensure that each value is appended to the Value property in the order that the Modify methods are invoked.

 

What should you do?

 

clip_image016

 

A.

Option A

B.

Option B

C.

Option C

D.

Option D

 

Correct Answer: B

 

Instant Access to Download Testing Software & PDF File for Microsoft 70-483 Real Exam

Instant Access to Try Microsoft 70-483 Free Demo

HOT EXAM!

Name of author

Name: admin