Microsoft Programming in C# 70-483 Exam Questions

Page: 1 / 14
Total 304 questions
Question 1

You plan to create a list of customers named customers. Each customer will have a name and a key. The name and the key will be strings.

You will use the following code to retrieve customers from the list.

customers[aKey].toString();

You need to identify which class must be used to declare the customers list. The solution must ensure that each key is unique. Which class should you identify?



Answer : B


Question 2

You have the following line of code. Type type1 = typeof^MyClass);

You need to create an object named obj that has a type of type1.

Which line of code should you use?



Answer : B


Question 3

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

You need to ensure that the application does not throw exceptions on invalid conversions.

Which code segment should you insert at line 04?



Answer : A

Explicit cast of object into float, and then another Explicit cast of float into int.


https://msdn.microsoft.com/en-us/library/xhbhezf4.aspx

Question 4

You are developing an application that includes a class named Customer and a generic list of customers. The following code segment declares the list of customers:

List customersList = new List () ;

You populate the customersList object with several hundred Customer objects.

The application must display the data for five Customer objects at a time.

You need to create a method that will return the correct number of Customer objects.

Which code segment should you use?



Answer : A

Note: Something wrong with question as the question is about LINQ, while the answers are about class definitions (and not LINQ method definitions).


Question 5

You need to store the values in a collection.

The solution must meet the following requirements:

The values must be stored in the order that they were added to the collection.

The values must be accessed in a first-in, first-out order.

Which type of collection should you use?



Answer : B

The Queue class implements a queue as a circular array. Objects stored in a Queue are inserted at one end and removed from the other.

Queues and stacks are useful when you need temporary storage for information; that is, when you might want to discard an element after retrieving its value. Use Queue if you need to access the information in the same order that it is stored in the collection.


Question 6

You are developing an application that uses multiple asynchronous tasks to optimize performance. The application will be deployed in a distributed environment.

You need to retrieve the result of an asynchronous task that retrieves data from a web service.

The data will later be parsed by a separate task.

Which code segment should you use?



Answer : B

Example:

// Signature specifies Task<TResult>

async Task<int> TaskOfTResult_MethodAsync()

{

int hours;

// . . .

// Return statement specifies an integer result.

return hours;

}

// Calls to TaskOfTResult_MethodAsync

Task<int> returnedTaskTResult = TaskOfTResult_MethodAsync();

int intResult = await returnedTaskTResult;

// or, in a single statement

int intResult = await TaskOfTResult_MethodAsync();

// Signature specifies Task

async Task Task_MethodAsync()

{

// . . .

// The method has no return statement.

}

// Calls to Task_MethodAsync

Task returnedTask = Task_MethodAsync();

await returnedTask;

// or, in a single statement

await Task_MethodAsync();


https://msdn.microsoft.com/en-us/library/hh191443.aspx

Question 7

You are developing an application that will transmit large amounts of data between a client computer and a server. You need to ensure the validity of the data by using a cryptographic hashing algorithm. Which algorithm should you use?



Answer : D

The HMACSHA512 class computes a Hash-based Message Authentication Code (HMAC) using the SHA512 hash function.


Page:    1 / 14   
Total 304 questions