70-483 Exam - Programming in C#

certleader.com

Q1. - (Topic 1) 

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? 

A. RSA 

B. HMACSHA2S6 

C. Aes 

D. RNGCryptoServiceProvider 

Answer:

Q2. - (Topic 2) 

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? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:

Q3. - (Topic 2) 

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

When you execute the code, you get an exception. 

You need to ensure that B_Products contain all of the products that start with the letter “B”. What should you do? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:

Explanation: Simply select the product items. 

Q4. - (Topic 2) 

You are modifying an existing application that manages employee payroll. The application includes a class named PayrollProcessor. The PayrollProcessor class connects to a payroll database and processes batches of paychecks once a week. 

You need to ensure that the PayrollProcessor class supports iteration and releases database connections after the batch processing completes. 

Which two interfaces should you implement? (Each correct answer presents part of the complete solution. Choose two.) 

A. IEquatable 

B. IEnumerable 

C. IDisposable 

D. IComparable 

Answer: B,C 

Explanation: IEnumerable IDisposable Interface Exposes an enumerator, which supports a simple iteration over a non-generic collection. 

Defines a method to release allocated resources. 

The primary use of this interface is to release unmanaged resources. 

Q5. - (Topic 1) 

You are developing an application by using C#. You provide a public key to the 

development team during development. 

You need to specify that the assembly is not fully signed when it is built. 

Which two assembly attributes should you include in the source code? (Each correct 

answer presents part of the solution. Choose two.) 

A. AssemblyFlagsAttribute 

B. AssemblyKeyFileAttribute 

C. AssemblyConfigurationAttribute 

D. AssemblyDelaySignAttribute 

Answer: B,D 

Q6. - (Topic 2) 

You have the following code: 

You need to retrieve all of the numbers from the items variable that are greater than 80. Which code should you use? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:

Explanation: Enumerable.Where<TSource> Method (IEnumerable<TSource>, 

Func<TSource, Boolean>) 

Filters a sequence of values based on a predicate. 

Example: 

List<string> fruits = 

new List<string> { "apple", "passionfruit", "banana", "mango", 

"orange", "blueberry", "grape", "strawberry" }; 

IEnumerable<string> query = fruits.Where(fruit => fruit.Length < 6); 

foreach (string fruit in query) 

Console.WriteLine(fruit); 

/* 

This code produces the following output: 

apple 

mango 

grape */ 

Q7. DRAG DROP - (Topic 2) 

You are developing an application that implements a set of custom exception types. You declare the custom exception types by using the following code segments: 

The application includes a function named DoWork that throws .NET Framework exceptions and custom exceptions. The application contains only the following logging methods: 

The application must meet the following requirements: 

. When ContosoValidationException exceptions are caught, log the information by using the static void Log (ContosoValidationException ex) method. . When ContosoDbException or other ContosoException exceptions are caught, log the information by using the static void Log(ContosoException ex) method. 

You need to meet the requirements. 

You have the following code: Which code segments should you include in Target 1, Target 2 and Target 3 to complete the code? (To answer, drag the appropriate code segments to the correct targets in the answer area. 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.) 

Answer:  

Q8. - (Topic 2) 

You are developing an application that includes the following code segment: 

You need to implement the Open() method of each interface in a derived class named UseResources and call the Open() method of each interface. 

Which two code segments should you use? (Each correct answer presents part of the solution. Choose two.) 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer: A,C 

Explanation: 

* An interface contains only the signatures of methods, properties, events or indexers. A class or struct that implements the interface must implement the members of the interface that are specified in the interface definition. 

* Example: interface ISampleInterface { void SampleMethod(); } 

class ImplementationClass : ISampleInterface 

// Explicit interface member implementation: 

void ISampleInterface.SampleMethod() 

// Method implementation. 

static void Main() 

// Declare an interface instance. 

ISampleInterface obj = new ImplementationClass(); 

// Call the member. 

obj.SampleMethod(); 

Q9. HOTSPOT - (Topic 2) 

You have the following code: 

For each of the following statements, select Yes if the statement is true. Otherwise, select No. 

Answer:  

Q10. HOTSPOT - (Topic 1) 

You have the following code: 

For each of the following statements, select Yes if the statement is true. Otherwise, select No. 

Answer: