Q1. - (Topic 1)
You are creating a console application by using C#.
You need to access the assembly found in the file named car.dll.
Which code segment should you use?
A. Assembly.Load();
B. Assembly.GetExecutingAssembly();
C. This.GetType();
D. Assembly.LoadFile("car.dll");
Answer: D
Explanation:
Assembly.LoadFile - Loads the contents of an assembly file on the specified path. http://msdn.microsoft.com/en-us/library/b61s44e8.aspx
Q2. - (Topic 2)
You are developing an application that includes a class named Employee and a generic list
of employees. The following code segment declares the list of employees:
List<Employee> employeesList = new List<Employee>();
You populate the employeesList object with several hundred Employee objects.
The application must display the data for five Employee objects at a time.
You need to create a method that will return the correct number of Employee objects.
Which code segment should you use?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: B
Q3. - (Topic 2)
You develop an application by using C#. The application counts the number of times a specific word appears within a set of text files. The application includes the following code. (Line numbers are included for reference only.)
You have the following requirements:
. Populate the _wordCounts object with a list of words and the number of occurrences of each word. . Ensure that updates to the ConcurrentDictionary object can happen in parallel.
You need to complete the relevant code.
Which code segment should you insert at line 23?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: A
Q4. - (Topic 2)
You are developing an application that uses multiple asynchronous tasks to optimize performance.
You need to retrieve the result of an asynchronous task.
Which code segment should you use?
A. Option A B. Option B
C. Option C
D. Option D
Answer: C
Q5. - (Topic 2)
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<Customer> customersList = new List<Customer> () ;
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?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: A
Q6. - (Topic 2)
You are developing a C# application. The application references and calls a RESTful web service named EmployeeService. The EmployeeService web service includes a method named GetEmployee, which accepts an employee ID as a parameter. The web service returns the following JSON data from the method.
{"Id":1,"Name":"David Jones">
The following code segment invokes the service and stores the result:
You need to convert the returned JSON data to an Employee object for use in the application.
Which code segment should you use?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: C