070-483試験無料問題集「Microsoft Programming in C# 認定」

You have the following code:

You need to display all of the vehicles that start with the letter "A".
How should you complete the code? To answer, drag the appropriate code elements to the correct targets. 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.
NOTE: Each correct selection is worth one point.
正解:
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?

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?

You have the following code (line numbers are included for reference only):

To answer, complete each statement according to the information presented in the code.
正解:
You are developing an application that includes the following code segment:

You need to implement both Start() methods in a derived class named UseStart that uses the Start() method of each interface.
Which two code segments should you use? (Each correct answer presents part of the solution. Choose two.)

解説: (GoShiken メンバーにのみ表示されます)
You have the following code.

正解:
You are creating a method that will split a single input file into two smaller output files.
The method must perform the following actions:
* Create a file named header.dat that contains the first 20 bytes of the input file.
* Create a file named body.dat that contains the remainder of the input file.
You need to create the method.
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.)
正解:

Explanation:
"offset" and "count" parameters of "Stream.Read" / "Stream.Write" methods ALWAYS refer to the array you are sending in the first parameter.
The position of fsSource advances as you read it, unless you seed on it.
You are developing an application that will include a method named GetData. The GetData() method will retrieve several lines of data from a web service by using a System.IO.StreamReader object.
You have the following requirements:
* The GetData() method must return a string value that contains the first line of the response from the web service.
* The application must remain responsive while the GetData() method runs.
You need to implement the GetData() method.
How should you complete the relevant code? (To answer, drag the appropriate objects to the correct locations in the answer area. Each object 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.)
正解:

Explanation:
Box 1. async Box 2. await Box 3. ReadLineAsync();
Incorrect:
Not Box 3: ReadToEndAsync() is not correct since only the first line of the response is required.
You are creating a class named Loan.
The Loan class must meet the following requirements:
* Include a member that represents the rate for a Loan instance.
* Allow external code to assign a value to the rate member.
* Restrict the range of values that can be assigned to the rate member.
You need to implement the rate member to meet the requirements.
In which form should you implement the rate member?

解説: (GoShiken メンバーにのみ表示されます)
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?

解説: (GoShiken メンバーにのみ表示されます)
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:

You need to ensure that the application preserves the element ordering as provided in the XML stream.
You have the following code:

Which attributes should you include in Target 1, Target 2 and Target 3 to complete the code? (To answer, drag the appropriate attributes to the correct targets 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.)
正解:

Explanation:
Target 1: The DataContractAttribute.Namespace Property gets or sets the namespace for the data contract for the type. Use this property to specify a particular namespace if your type must return data that complies with a specific data contract.
Target2, target3: We put Order=10 on FirstName to ensure that LastName is ordered first.
Note:
The basic rules for data ordering include:
* If a data contract type is a part of an inheritance hierarchy, data members of its base types are always first in the order.
* Next in order are the current type's data members that do not have the Order property of the DataMemberAttribute attribute set, in alphabetical order.
* Next are any data members that have the Order property of the DataMemberAttribute attribute set. These are ordered by the value of the Order property first and then alphabetically if there is more than one member of a certain Order value. Order values may be skipped.
Reference:
https://msdn.microsoft.com/en-us/library/ms729813(v=vs.110).aspx
https://msdn.microsoft.com/en-us/library/system.runtime.serialization.datacontractattribute.namespace(v=vs.110).aspx
You have a List object that is generated by executing the following code:

You have a method that contains the following code (line numbers are included for reference only):

You need to alter the method to use a lambda statement.
How should you rewrite lines 03 through 06 of the method?

解説: (GoShiken メンバーにのみ表示されます)
You have an assembly named Assenbly1 that is written in C#. Assembly1 has a method named Hethodl.
You add a new method named Method2 to Assembly1. Hethod2 is a newer version of Methodl and must be used by applications in the future.
You need to ensure that if a developer builds a project that uses Hethodl, the developer is notified that Method1 is deprecated.
What should you do?

You are developing an application in C#.
The application uses exception handling on a method that is used to execute mathematical calculations by using integer numbers.
You write the following catch blocks for the method (line numbers are included for reference only):

You need to add the following code to the method:

At which line should you insert the code?

You are developing an application by using C#.
The application includes an object that performs a long running process.
You need to ensure that the garbage collector does not release the object's resources until the process completes.
Which garbage collector method should you use?

解説: (GoShiken メンバーにのみ表示されます)
You are developing an application in C#.
You need to create an anonymous method.
You write the following code segment.

How should you complete the code? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
正解:

Explanation:
Target 1: delegate
Target 2: void
Target 3: delegate