070-483 無料問題集「Microsoft Programming in C#」

You are creating a console application named App1.
App1 will validate user input for order entries.
You are developing the following code segment (line numbers are included for reference only):

You need to complete the code segment.
The solution must ensure that prices are positive and have two decimal places.
Which code should you insert at line 03?

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

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

解説: (JPNTest メンバーにのみ表示されます)
You are testing an application. The application includes methods named CalculateInterest and LogLine. The CalculateInterest() method calculates loan interest. The LogLine() method sends diagnostic messages to a console window.
The following code implements the methods. (Line numbers are included for reference only.)

You have the following requirements:
* The CalculateInterest() method must run for all build configurations.
* The LogLine() method must run only for debug builds.
You need to ensure that the methods run correctly.
What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two.)

正解:B、E 解答を投票する
解説: (JPNTest メンバーにのみ表示されます)
You have an application that accesses a Web server named Server1.
You need to download an image named Imagel.jpg from Server1 and store the image locally as Filel.jpg.
Which code should you use?

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 DataContractSeria.izer object that is declared by the following code segment:

Which attributes should you include in Target lf 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.)
正解:
You are developing an application that will write string values to a file. The application includes the following code segment. (Line numbers are included for reference only.)
01 protected void ProcessFile(string fileName, string value)
02 {
03
04 }
You need to ensure that the ProcessFile() method will write string values 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.)
正解:

Explanation:
Note:
* Example:
1. StreamWriter.Null Field
Provides a StreamWriter with no backing store that can be written to, but not read from.
2. The StreamWriter Constructor (String) initializes a new instance of the StreamWriter class for the specified file by using the default encoding and buffer size.
3. The StreamWriter.Write method writes data to the stream.
4. The StreamWriter.Close method closes the current StreamWriter object and the underlying stream.
Incorrect:
Not StreamWrite.Open();
The StreamWriter Class does not have any method named Open.
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?

解説: (JPNTest メンバーにのみ表示されます)
You are developing an application by using C#.
You have the following requirements:
* Support 32-bit and 64-bit system configurations.
* Include pre-processor directives that are specific to the system configuration.
* Deploy an application version that includes both system configurations to testers.
* Ensure that stack traces include accurate line numbers.
You need to configure the project to avoid changing individual configuration settings every time you deploy the application to testers.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

正解:C、D 解答を投票する
解説: (JPNTest メンバーにのみ表示されます)
You have the following code.

You need to complete the method to return the content as a string.
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.
正解:
You are modifying an existing application.
The application includes a Loan class and a Customer class. The following code segment defines the classes.

You populate a collection named customer-Collection with Customer and Loan objects by using the following code segment:

You create a largeCustomerLoans collection to store the Loan objects by using the following code segment:
Collection<Loan> largeCustomerLoans = new Collection<Loan>();
All loans with an Amount value greater than or equal to 4000 must be tracked.
You need to populate the largeCustomerLoans collection with Loan objects.
Which code segment should you use?

解説: (JPNTest メンバーにのみ表示されます)
You need to write a console application that meets the following requirements:
If the application is compiled in Debug mode, the console output must display Entering debug mode. If the application is compiled in Release mode, the console output must display Entering release mode.
Which code should you use?

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.
After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.
You have the following C# code. (Line numbers are included for reference only.)

You need the foreach loop to display a running total of the array elements, as shown in the following output.
1
3
6
10
15
Solution: You insert the following code at line 02:

Does this meet the goal?

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

解説: (JPNTest メンバーにのみ表示されます)
You are developing an application that includes a class named Warehouse. The Warehouse class includes a static property named Inventory- The Warehouse class is defined by the following code segment. (Line numbers are included for reference only.)

You have the following requirements:
* Initialize the _inventory field to an Inventory instance.
* Initialize the _inventory field only once.
* Ensure that the application code acquires a lock only when the _inventory 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.)
正解:

1 - if (_inventory == null)
2 - lock (_lock)
3 - if (_inventory == null) _inventory = new Inventory ( ) ;
Explanation:
After taking a lock you must check once again the _inventory field to be sure that other threads didn't instantiated it in the meantime.
First, you check if the inventory is null, if so, you lock it to avoid other threads to change it.
Second, you check again for the null, as in the tiny millisecond between check for null and locking could another thread get it.
Finally you create the instance and release the lock.
An application contains code that measures reaction times. The code runs the timer on a thread separate from the user interface. The application includes the following code. (Line numbers are included for reference only.)

You need to ensure that the application cancels the timer when the user presses the Enter key.
Which code segment should you insert at line 14?

解説: (JPNTest メンバーにのみ表示されます)

弊社を連絡する

我々は12時間以内ですべてのお問い合わせを答えます。

オンラインサポート時間:( UTC+9 ) 9:00-24:00
月曜日から土曜日まで

サポート:現在連絡