Q1. DRAG DROP - (Topic 1)
You are developing an application by using C#. The application includes an array of decimal values named loanAmounts. You are developing a LINQ query to return the values from the array.
The query must return decimal values that are evenly divisible by two. The values must be sorted from the lowest value to the highest value.
You need to ensure that the query correctly returns the decimal values.
How should you complete the relevant code? (To answer, drag the appropriate code segments to the correct locations 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:
Q2. 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:
Q3. DRAG DROP - (Topic 2)
You write the following code.
You need to get the list of all the types defined in the assembly that is being executed currently.
How should you complete the code? To answer, drag the appropriate code elements to the correct targets in the answer area. Each code element 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:
Q4. HOTSPOT - (Topic 1)
You are implementing a library method that accepts a character parameter and returns a string.
If the lookup succeeds, the method must return the corresponding string value. If the lookup fails, the method must return the value "invalid choice."
You need to implement the lookup algorithm.
How should you complete the relevant code? (To answer, select the correct keyword in each drop-down list in the answer area.)
Answer:
Q5. - (Topic 2)
You are creating a console application named Appl.
App1 retrieves data from the Internet by using JavaScript Object Notation (JSON).
You are developing the following code segment (line numbers are included for reference only):
You need to ensure that the code validates the JSON string. Which code should you insert at line 03?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: B
Explanation: The JavaScriptSerializer Class Provides serialization and deserialization functionality for AJAX-enabled applications.
The JavaScriptSerializer class is used internally by the asynchronous communication layer to serialize and deserialize the data that is passed between the browser and the Web server. You cannot access that instance of the serializer. However, this class exposes a public API. Therefore, you can use the class when you want to work with JavaScript Object Notation (JSON) in managed code.
Q6. DRAG DROP - (Topic 1)
You are developing an application that includes a class named Kiosk. The Kiosk class includes a static property named Catalog. The Kiosk class is defined by the following code segment. (Line numbers are included for reference only.)
You have the following requirements:
Initialize the _catalog field to a Catalog instance.
Initialize the _catalog field only once.
Ensure that the application code acquires a lock only when the _catalog object must be instantiated.
You need to meet the requirements.
Which three code segments should you insert in sequence at line 09? (To answer, move the appropriate code segments from the list of code segments to the answer area and arrange them in the correct order.)
Answer:
Q7. - (Topic 2)
You are developing an application that includes the following code segment. (Line numbers are included for reference only.)
You need to ensure that the DoWork(Widget widget) method runs.
With which code segment should you replace line 24?
A. DoWork((Widget)o);
B. DoWork(new Widget(o));
C. DoWork(o is Widget);
D. DoWork((ItemBase)o);
Answer: A
Q8. HOTSPOT - (Topic 1)
You are developing an application that includes a Windows Communication Foundation (WCF) service. The service includes a custom TraceSource object named ts and a method named DoWork. The application must meet the following requirements:
. Collect trace information when the DoWork() method executes. . Group all traces for a single execution of the DoWork() method as an activity that can be viewed in the WCF Service Trace Viewer Tool.
You need to ensure that the application meets the requirements.
How should you complete the relevant code? (To answer, select the correct code segment from each drop-down list in the answer area.)
Answer:
Q9. DRAG DROP - (Topic 1)
You are developing an application by using C#. The application will output the text string "First Line" followed by the text string "Second Line".
You need to ensure that an empty line separates the text strings.
Which four code segments should you use in sequence? (To answer, move the appropriate code segments to the answer area and arrange them in the correct order.)
Answer:
Q10. - (Topic 2)
You are developing an application that produces an executable named MyApp.exe and an assembly named MyApp.dll.
The application will be sold to several customers.
You need to ensure that enough debugging information is available for MyApp.exe, so that if the application throws an error in a customer's environment, you can debug the error in your own development environment.
What should you do?
A. Digitally sign MyApp.dll.
B. Produce program database (PDB) information when you compile the code.
C. Compile MyApp.exe by using the /unsafe compiler option.
D. Initializes a new instance of the AssemblyDelaySignAttribute class in the MyApp.dll constructor.
Answer: B