Download New Updated (June) Microsoft 70-483 Practice Test 141-150

Ensurepass

 

QUESTION 141

You are troubleshooting an application that uses a class named FullName. The class is decorated with the DataContractAttribute attribute. The application includes the following code. (Line numbers are included for reference only.)

 

clip_image002

 

You need to ensure that the entire FullName object is serialized to the memory stream object.

 

Which code segment should you insert at line 09?

 

A.

binary.WriteEndDocument();

B.

binary.WriteEndDocumentAsync();

C.

binary.WriteEndElementAsync();

D.

binary.Flush();

 

Correct Answer: A

Explanation:

* DataContractSerializer.WriteEndObject Method (XmlDictionaryWriter) Writes the closing XML element using an XmlDictionaryWriter.

 

* Note on line 07: DataContractSerializer.WriteObject Method Writes all the object data (starting XML element, content, and closing element) to an XML document or stream.

 

XmlDictionaryWriter

 

 

QUESTION 142

You need to write a method that retrieves data from a Microsoft Access 2013 database. The method must meet the following requirements:

 

clip_image004Be read-only.

clip_image004[1]Be able to use the data before the entire data set is retrieved.

clip_image004[2]Minimize the amount of system overhead and the amount of memory us
age.

 

Which type of object should you use in the method?

 

A.

DbDataReader

B.

DataContext

C.

unTyped DataSet

D.

DbDataAdapter

 

Correct Answer: A

Explanation:

DbDataReader Class

Reads a forward-only stream of rows from a data source.

 

 

QUESTION 143

HOTSPOT

You define a class by using the following code:

 

clip_image006

 

You write the following code for a method (line numbers are included for reference only):

 

clip_image008

 

To answer, complete each statement according to the information presented in the code.

 

clip_image010

 

Correct Answer:

clip_image012

 

 

QUESTION 144

You are creating a console application named App1.

 

App1 will validate user input for order entries.

 

You are developing the following code segment (line numbers are included for reference only):

 

clip_image014

 

You need to complete the code segment.

 

The solution must ensure that prices are positive and have two decimal places.

 

Which code should you insert at line 03?

 

clip_image016

 

A.

Option A

B.

Option B

C.

Option C

D.

Option D

 

Correct Answer: C

Explanation:

* Regex.IsMatch Method (String, String) Indicates whether the specified regular expression finds a match in the specified input string.

 

Syntax:

public static bool IsMatch(

string input,

string pattern

)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

QUESTION 145

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

 

clip_image018

 

You need to ensure that if an exception occurs, the exception will be logged.

 

Which code should you insert at line 28?

 

clip_image020

 

A.

Option A

B.

Option B

C.

Option C

D.

Option D

 

Correct Answer: C

Explanation:

* XmlWriterTraceListener

Directs tracing or debugging output as XML-encoded data to a TextWriter or to a Stream, such as a FileStream.

 

* TraceListener.TraceEvent Method (TraceEventCache, String, TraceEventType, Int32) Writes trace and event information to the listener specific output.

 

Syntax:

[ComVisibleAttribute(false)]

public virtual void TraceEvent(

TraceEventCache eventCache,

string source,

TraceEventType eventType,

int id

)

 

 

 

 

 

 

 

QUESTION 146

You have the following code:

 

clip_image022

 

You need to retrieve all of the numbers from the items variable that are greater than 80.

 

Which code should you use?

 

clip_image024

 

A.

Option A

B.

Option B

C.

Option C

D.

Option D

 

Correct Answer: A

 

 

 

 

 

 

 

 

 

 

 

 

 

QUESTION 147

You are creating a console application named App1.

 

App1 retrieves data from the Internet by using JavaScript Object Notation (JSON).

 

You are developing the following code segment (line numbers are included for reference only):

 

clip_image026

 

You need to ensure that the code validates the JSON string.

 

Which code should you insert at line 03?

 

clip_image028

 

A.

Option A

B.

Option B

C.

Option C

D.

Option D

 

Correct Answer: D

Explanation:

The JavaScriptSerializer Class Provides serialization and deserialization functionality for AJAX-enabled applications.

 

The JavaScriptSerializer class is used internally by the asynchronous communication layer to serialize and deserialize the data that is passed between the browser and the Web server. You cannot access that instance of the serializer. However, this class exposes a public API. Therefore, you can use the class when you want to work with JavaScript Object Notation (JSON) in managed code.

 

QUESTION 148

You are evaluating a method that calculates loan interest- The application includes the following code segment. (Line numbers are included for reference only.)

 

clip_image030

 

When the loanTerm value is 3 and the loanAmount value is 9750, the loanRate must be set to 8.25 percent. You need to adjust the loanRate value to meet the requirements.

 

What should you do?

 

A.

Replace line 04 with the following code segment:

decimal loanRate = 0.0325m;

B.

Replace line 17 with the following code segment:

interestAmount = loanAmount * 0.0825m * loanTerm;

C.

Replace line 15 with the following code segment:

loanRate = 0.0825m;

D.

Replace line 07 with the following code segment:

loanRate = 0.0825m;

 

Correct Answer: C

 

 

QUESTION 149

You are implementing a new method named ProcessData. The ProcessData() method calls a third-party component that performs a long-running operation.

 

The third-party component uses the IAsyncResult pattern to signal completion of the long- running operation.

 

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

 

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

Choose two.)

 

A.

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

B.

Create a TaskCompletionSource<T> object.

C.

Apply the async modifier to the method signature.

D.

Apply the following attribute to the method signature:

[MethodImpl(MethodImplOptions.Synchronized)]

 

Correct Answer: AB

Explanation:

A: 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.

 

B: 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.

 

Note:

* System.Threading.Tasks.Task

Represents an asynchronous operation.

 

 

QUESTION 150

You are developing an application for a bank. The application includes a method named ProcessLoan that processes loan applications. The ProcessLoan() method uses a method named CalculateInterest. The application includes the following code:

 

You need to declare a delegate to support the ProcessLoan() method.

 

Which code segment should you use?

 

clip_image032

 

A.

Option A

B.

Option B

C.

Option C

D.

Option D

 

Correct Answer: C

 

Free VCE & PDF File for Microsoft 70-483 Real Exam

Instant Access to Free VCE Files: MCSE|MCSA|MCITP…
Instant Access to Free PDF Files: MCSE|MCSA|MCITP…