Q1. DRAG DROP - (Topic 1)
An application serializes and deserializes XML from streams. The XML streams are in the following format:
The application reads the XML streams by using a DataContractSerializer object that is declared by the following code segment:
var ser = new DataContractSerializer(typeof(Name));
You need to ensure that the application preserves the element ordering as provided in the XML stream.
How should you complete the relevant code? (To answer, drag the appropriate attributes to the correct locations in the answer area-Each attribute 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. - (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
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. - (Topic 2)
You are developing an application that will manage customer records. The application includes a method named FindCustomer.
Users must be able to locate customer records by using the customer identifier or customer name.
You need to implement the FindCustomer() method to meet the requirement.
Which two sets of method signatures can you use to achieve this goal? (Each correct answer presents a complete solution. Choose two.)
A. Option A
B. Option B
C. Option C
D. Option D
Answer: B,D
Q5. DRAG DROP - (Topic 2)
You are developing an application that will write data to a file. The application includes the following code segment. (Line numbers are included for reference only.)
You need to ensure that the WriteData() method will write data to a file.
Which four code segments should you insert in sequence at line 03? (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:
Q6. - (Topic 1)
An application includes a class named Person. The Person class includes a method named GetData.
You need to ensure that the GetData() from the Person class.
Which access modifier should you use for the GetData() method?
A. Internal
B. Protected
C. Private
D. Protected internal
E. Public
Answer: B
Explanation:
Protected - The type or member can be accessed only by code in the same class or structure, or in a class that is derived from that class. http://msdn.microsoft.com/en-us/library/ms173121.aspx The protected keyword is a member access modifier. A protected member is accessible within its class and by derived class instances.
Q7. HOTSPOT - (Topic 1)
You have the following code: To answer, complete each statement according to the information presented in the code.
Answer:
Q8. - (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: JavaScriptSerializer().Deserialize
Converts the specified JSON string to an object of type T.
Example:
string json = File.ReadAllText(Environment.CurrentDirectory + @"\JSON.txt");
Company company = new
System.Web.Script.Serialization.JavaScriptSerializer().Deserialize<Company>(
Reference: C# - serialize object to JSON format using JavaScriptSerializer
http://matijabozicevic.com/blog/csharp-net-development/csharp-serialize-object-to-json-format-using-javascriptserialization
Q9. - (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: A
Q10. - (Topic 1)
You are developing an application that includes a class named BookTracker for tracking library books. The application includes the following code segment. (Line numbers are included for reference only.)
You need to add a user to the BookTracker instance. What should you do? A. Option A
B. Option B
C. Option C
D. Option D
Answer: B