Ensurepass


QUESTION 11

You are developing an application. The application includes classes named Employee and Person and

an interface named IPerson.

The Employee class must meet the following requirements:

-It must either inherit from the Person class or implement the IPerson interface.

-It must be inheritable by other classes in the application.

You need to ensure that the Employee class meets the requirements.

Which two code segments can you use to achieve this goal? (Each correct answer presents a complete solution. Choose two.)

clip_image002

A. Option A

B. Option B

C. Option C

D. Option D

Correct Answer: BD


QUESTION 12

You are developing an application that will convert data into multiple output formats.

The application includes the following code. (Line numbers are included for reference only.)

clip_image004

You are developing a code segment that will produce tab-delimited output. All output routines implement the

following interface:

You need to minimize the completion time of the GetOutput() method. Which code segment should you insert at line 06?

clip_image006

A. Option A

B. Option B

C. Option C

D. Option D

Correct Answer: B


QUESTION 13

You are developing an application by using C#.

The application includes an object that performs a long running process.

You need to ensure that the garbage collector does not release the object’s resources until the process completes.

Which garbage collector method should you use?

A. ReRegisterForFinalize()

B. SuppressFinalize()

C. Collect()

D. WaitForFullGCApproach()

Correct Answer: B


QUESTION 14

You are creating a class named Employee. The class exposes a string property named EmployeeType.

The following code segment defines the Employee class. (Line numbers are included for reference only.)

clip_image008

The EmployeeType property value must be accessed and modified only by code within the Employee class or within a class derived from the Employee class.

You need to ensure that the implementation of the EmployeeType property meets the requirements. Which action should you perform?.

Choose two.)

A. Replace line 05 with the following code segment: protected get;

B. Replace line 06 with the following code segment: private set;

C. Replace line 03 with the following code segment: public string EmployeeType

D. Replace line 05 with the following code segment: private get;

E. Replace line 03 with the following code segment: protected string EmployeeType

F. Replace line 06 with the following code segment: protected set;

Correct Answer: E


QUESTION 15

You are implementing a method named Calculate that performs conversions between value types and

reference types. The following code segment implements the method. (Line numbers are included for reference only.)

clip_image010

You need to ensure that the application does not throw exceptions on invalid conversions. Which code segment should you insert at line 04?

A. int balance = (int)(float)amountRef;

B. int balance = (int)amountRef;

C. int balance = amountRef;

D. int balance = (int) (double) amountRef;

Correct Answer: A


QUESTION 16

You are creating a console application by using C#.

You need to access the application assembly. Which code segment should you use?

A. Assembly.GetAssembly(this);

B. This.GetType();

C. Assembly.Load();

D. Assembly.GetExecutingAssembly();

Correct Answer: D


QUESTION 17

You use the Task.Run() method to launch a long-running data processing operation. The data

processing operation often fails in times of heavy network congestion.

If the data processing operation fails, a second operation must clean up any results of the first operation. You need to ensure that the second operation is invoked only if the data processing operation throws an unhandled exception.

What should you do?

A. Create a TaskCompletionSource<T> object and call the TrySetException() method of the object.

B. Create a task by calling the Task.ContinueWith() method

C. Examine the Task.Status property immediately after the call to the Task.Run() method.

D. Create a task inside the existing Task.Run() method by using the AttachedToParent option.

Correct Answer: B


QUESTION 18

You are modifying an application that processes leases. The following code defines the Lease class.

(Line numbers are included for reference only.)

clip_image012

Leases are restricted to a maximum term of 5 years. The application must send a notification message if a lease request exceeds 5 years.

You need to implement the notification mechanism.

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

clip_image013

A. Option A

B. Option B

C. Option C

D. Option D

E. Option E

F. Option F

Correct Answer: AB


QUESTION 19

You are developing an application that uses structured exception handling. The application includes a

class named ExceptionLogger.

The ExceptionLogger class implements a method named LogException by using the following code segment:

public static void LogException(Exception ex) You have the following requirements:

-Log all exceptions by using the LogException() method of the ExceptionLogger class.

-Rethrow the original exception, including the entire exception stack. You need to meet the requirements.

Which code segment should you use?

clip_image015

A. Option A

B. Option B

C. Option C

D. Option D

Correct Answer: A


QUESTION 20

You are developing an application that includes a class named UserTracker. The application includes

the following code segment. (Line numbers are included for reference only.)

clip_image017

You need to add a user to the UserTracker instance. What should you do?

clip_image019

A. Option A

B. Option B

C. Option C

D. Option D

Correct Answer: D

 

Download Latest 70-483 Real Free Tests , help you to pass exam 100%.

Comments are closed.