1.
You need to create a method to clear a Queue named q. Which code segment should you use?
2.
You are testing a method that examines a running process. This method returns an ArrayList containing the name and full path of all modules that are loaded by the process. You need to list the modules loaded by a
process named C:\TestApps\Process1.exe. Which code segment should you use?
3.
You need to write a multicast delegate that accepts a DateTime argument. Which code segment should you use?
4.
Your application uses two threads, named threadOne and threadTwo. You need to modify the code to prevent the execution of threadOne until threadTwo completes execution. What should you do?
5.
You are developing a fiscal report for a customer. Your customer has a main office in the United States and a satellite office in Mexico. You need to ensure that when users in the satellite office generate the report, the
current date is displayed in Mexican Spanish format.
Which code segment should you use?
6.
You write the following custom exception class named CustomException.
public class CustomException : ApplicationException
{
public static int COR_E_ARGUMENT = unchecked((int)0x80070057);
public CustomException(string msg) : base(msg)
{
HResult = COR_E_ARGUMENT;
}
}
You need to write a code segment that will use the CustomException class to immediately return control to the COM caller. You also need to ensure that the caller has access to the error code.
Which code segment should you use?
7.
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?
8.
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?
9.
You are developing an application to assist the user in conducting electronic surveys. The survey consists of 25 true-or-false questions. You need to perform the following tasks:
10.
You need to read the entire contents of a file named Message.txt into a single string variable.
Which code segment should you use?