You create a class library that is used by applications in three departments of your company. The library contains a Department class with the following definition.
public ref class Department {
public :
String= name;
String= manager;
};
Each application uses a custom configuration section to store department-specific values in the application
configuration file as shown in the following code. Hardware Amy
You need to write a code segment that creates a Department object instance by using the field values retrieved
from the application configuration file.
Which code segment should you use?
You are testing a newly developed method named PersistToDB. This method accepts a parameter of type EventLogEntry. This method does not return a value. You need to create a code segment that helps you to test the method. The code segment must read entries from the application log of local computers and then pass the entries on to the PersistToDB method. The code block must pass only events of type Error or Warning from the source MySource to the PersistToDB method.
Which code segment should you use?
You are writing a method that returns an ArrayList named al. You need to ensure that changes to the ArrayList are performed in a thread-safe manner. Which code segment should you use?
You are developing a method to encrypt sensitive data with the Data Encryption Standard (DES) algorithm.
Your method accepts the following parameters:
The byte array to be encrypted, which is named message
An encryption key, which is named key
An initialization vector, which is named iv
You need to encrypt the data. You also need to write the encrypted data to a MemoryStream object.
Which code segment should you use?
You are developing a method to hash data with the Secure Hash Algorithm. The data is passed to your method as a byte array named message. You need to compute the hash of the incoming parameter by using SHA1.
You also need to place the result into a byte array named hash. Which code segment should you use?
You are writing an application that uses SOAP to exchange data with other applications. You use a Department class that inherits from ArrayList to send objects to another application. The Department object is named dept.
You need to ensure that the application serializes the Department object for transport by using SOAP. Which code should you use?
You are developing an application for a client residing in Hong Kong. You need to display negative currency values by using a minus sign. Which code segment should you use?
You are developing an application to perform mathematical calculations. You develop a class named CalculationValues. You write a procedure named PerformCalculation that operates on an instance of the class.
You need to ensure that the user interface of the application continues to respond while calculations are being performed. You need to write a code segment that calls the PerformCalculation procedure to achieve this goal.
Which code segment should you use?
You are developing an application to perform mathematical calculations. You develop a class named CalculationValues. You write a procedure named PerformCalculation that operates on an instance of the class.
You need to ensure that the user interface of the application continues to respond while calculations are being performed. You need to write a code segment that calls the PerformCalculation procedure to achieve this goal.
Which code segment should you use?
You are creating a class that performs complex financial calculations. The class contains a method named GetCurrentRate that retrieves the current interest rate and a variable named currRate that stores the current
interest rate. You write serialized representations of the class. You need to write a code segment that updates the currRate variable with the current interest rate when an instance of the class is deserialized. Which code
segment should you use?