Microsoft 70-483 - MCSD Programming in C# Exam

Question #6 (Topic: Volume A)
DRAG DROP
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.)
Select and Place:
[Microsoft-70-483-1.0/xmlfile-10_1.jpg]
Answer: [Microsoft-70-483-1.0/xmlfile-10_2.jpg]
Question #7 (Topic: Volume A)
You are developing an application. The application includes a method named ReadFile that reads data from a file.
The ReadFile() method must meet the following requirements:
? It must not make changes to the data file.
? It must allow other processes to access the data file.
? It must not throw an exception if the application attempts to open a data file that does not exist.
You need to implement the ReadFile() method.
Which code segment should you use?
A. var fs = File.Open(Filename, FileMode.OpenOrCreate, FileAccess.Read,FileShare.ReadWrite); B. var fs = File.Open(Filename, FileMode.Open, FileAccess.Read,FileShare.ReadWrite); C. var fs = File.Open(Filename, FileMode.OpenOrCreate, FileAccess.Read,FileShare.Write); D. var fs = File.ReadAllLines(Filename); E. var fs = File.ReadAllBytes(Filename);
Answer: A
Question #8 (Topic: Volume A)
An application receives JSON data in the following format:
[Microsoft-70-483-1.0/xmlfile-12_1.png]
The application includes the following code segment. (Line numbers are included for reference only.)
[Microsoft-70-483-1.0/xmlfile-12_2.png]
You need to ensure that the ConvertToName() method returns the JSON input string as a Name object.
Which code segment should you insert at line 10?
A. Return ser.ConvertToType<Name>(json); B. Return ser.DeserializeObject(json); C. Return ser.Deserialize<Name>(json); D. Return (Name)ser.Serialize(json);
Answer: C
Question #9 (Topic: Volume A)
You are developing an application. The application converts a Location object to a string by using a method named WriteObject. The WriteObject() method
accepts two parameters, a Location object and an XmlObjectSerializer object.
The application includes the following code. (Line numbers are included for reference only.)
[Microsoft-70-483-1.0/xmlfile-14_1.jpg]
You need to serialize the Location object as a JSON object.
Which code segment should you insert at line 20?
A. New DataContractSerializer(typeof(Location)) B. New XmlSerializer(typeof(Location)) C. New NetDataContractSerializer() D. New DataContractJsonSerializer(typeof(Location))
Answer: D
Question #10 (Topic: Volume A)
You are developing an application by using C#. The application includes the following code segment. (Line numbers are included for reference only.)
[Microsoft-70-483-1.0/xmlfile-15_1.jpg]
The DoWork() method must not throw any exceptions when converting the obj object to the IDataContainer interface or when accessing the Data property.
You need to meet the requirements. Which code segment should you insert at line 07?
A. var dataContainer = (IDataContainer)obj; B. dynamic dataContainer = obj; C. var dataContainer = obj is IDataContainer; D. var dataContainer = obj as IDataContainer;
Answer: D
Download Exam
Page: 2 / 56
Total 280 questions