IT認証試験問題集
毎月、ITshikenは1500人以上の受験者が試験準備を助けて、試験に合格するために受験者にご協力します
 ホームページ / 70-483 問題集  / 70-483 問題練習

Microsoft 70-483 問題練習

Programming in C# 試験

最新更新時間: 2019/07/07,合計442問。

平成から令和へ:70-483 最新真題を買う時、日本語版と英語版両方を同時に獲得できます。

実際の問題集を練習し、試験のポイントを了解し、テストに申し込むするかどうかを決めることができます。

さらに試験準備時間の35%を節約するには、70-483 問題集を使用してください。

 / 30

Question No : 1
You write the following method (line numbers are included for reference only):



You need to ensure that the method extracts a list of URLs that match the following pattern:
@http://(www\.)?([^\.]+)\.com;
Which code should you insert at line 07?



正解:
Explanation:
The MatchCollection.GetEnumerator method returns an enumerator that iterates through a collection.
Note:
The MatchCollection Class represents the set of successful matches found by iteratively applying a regular expression pattern to the input string.
Incorrect:
Not B: The ICollection.SyncRoot property gets an object that can be used to synchronize access to the ICollection.
Reference: MatchCollection.GetEnumerator Method
https://msdn.microsoft.com/en-us/library/system.text.regularexpressions.matchcollection.getenumerator(v=vs.110).aspx

Question No : 2
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?



正解:
Explanation:
Programmatically detecting Release/Debug mode (.NET)
Boolean isDebugMode = false;
#if DEBUG
isDebugMode = true;
#endif
Reference: http://stackoverflow.com/questions/654450/programmatically-detecting-release-debug-mode-net

Question No : 3
DRAG DROP
You are developing an application that implements a set of custom exception types.
You declare the custom exception types by using the following code segments:



The application includes a function named DoWork that throws .NET Framework exceptions and custom exceptions. The application contains only the following logging methods:



The application must meet the following requirements:
• When ContosoValidationException exceptions are caught, log the information by using the static void Log (ContosoValidationException ex) method.
• When ContosoDbException or other ContosoException exceptions are caught, log the information by using the static void Log(ContosoException ex) method.
You need to meet the requirements.
You have the following code:



Which code segments should you include in Target 1, Target 2 and Target 3 to complete the code? (To answer, drag the appropriate code segments to the correct targets 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:
Catch the most specific exception first.

Question No : 4
DRAG DROP
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.



正解:


Explanation:
The AppDomain.CurrentDomain.GetAssemblies() gives you all assemblies loaded in the current application domain.
The Assembly class provides a GetTypes() method to retrieve all types within that particular assembly.
Example: Using Linq:
IEnumerable<Type> types =
from a in AppDomain.CurrentDomain.GetAssemblies()
from t in a.GetTypes()
select t;
Reference: http://stackoverflow.com/questions/4692340/find-types-in-all-assemblies

Question No : 5
You are developing an application that includes methods named ConvertAmount and TransferFunds. You need to ensure that the precision and range of the value in the amount variable is not lost when the TransferFunds() method is called.
Which code segment should you use?



正解:
Explanation:
The double keyword signifies a simple type that stores 64-bit floating-point values.
The float keyword signifies a simple type that stores 32-bit floating-point values.
Reference: double (C# Reference)

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



You need to ensure that new instances of Connection can be created only by other classes by calling the Create method. The solution must allow classes to inherit from Connection.
What should you do?



正解:
Explanation:
The following list provides the main features of a static class:
* Contains only static members.
* Cannot be instantiated.
* Is sealed.
* Cannot contain Instance Constructors.
Creating a static class is therefore basically the same as creating a class that contains only static members and a private constructor. A private constructor prevents the class from being instantiated.
Incorrect:
Not A: An abstract method is a method that is declared without an implementation.
Not C: Private methods can be called from derived classes.
Reference: Static Classes and Static Class Members (C# Programming Guide)
https://msdn.microsoft.com/en-us/library/79b3xss3.aspx

Question No : 7
HOTSPOT
A developer designs an interface that contains the following code:



For each of the following statements, select Yes if the statement is true. Otherwise, select No.



正解:

Question No : 8
DRAG DROP
You have the following class. (Line numbers are included for reference only.)



You need to complete the doOperation method to meet the following requirements:
• If AddNumb is passed as the operationName parameter, the AddNumb function is called.
• If SubNumb is passed as the operationName parameter, the SubNumb function is called.
Which code should you insert at line 16? Develop the solution by selecting and arranging the required code blocks in the correct order. You may not need all of the code blocks.




正解:


Explanation:
Note:
* target 2:
GetType() is a method you call on individual objects, to get the execution-time type of the object.
Incorrect: typeof is an operator to obtain a type known at compile-time (or at least a generic type parameter). The operand of typeof is always the name of a type or type parameter - never an expression with a value (e.g. a variable). See the C# language specification for more details.
Reference: What is the difference of getting Type by using GetType() and typeof()?
http://stackoverflow.com/questions/11312111/when-and-where-to-use-gettype-or-typeof

Question No : 9
DRAG DROP
You are developing a class named Temperature. You need to ensure that collections of Temperature objects are sortable.
You have the following code:



Which code segments should you include in Target 1, Target 2 and Target 3 to complete the code? (To answer, drag the appropriate code segments to the correct targets 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:
Note:
Target 1:
The role of IComparable is to provide a method of comparing two objects of a particular type. This is necessary if you want to provide any ordering capability for your object.
Incorrect: The role of IComparer is to provide additional comparison mechanisms. For example, you may want to provide ordering of your class on several fields or properties, ascending and descending order on the same field, or both.
Target 2, Target 3:
Example:
// Implement IComparable CompareTo method - provide default sort order.
int IComparable.CompareTo(object obj)
{
car c=(car)obj;
return String.Compare(this.make,c.make);
}
Reference: How to use the IComparable and IComparer interfaces in Visual C#
https://support.microsoft.com/en-us/kb/320727

Question No : 10
DRAG DROP
You are creating a class named Data that includes a dictionary object named _data. You need to allow the garbage collection process to collect the references of the _data object.
You have the following code:



Which code segments should you include in Target 1 and Target 2 to complete the 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:
* WeakReference influences the garbage collector. Most objects that are referenced must be kept in memory until they are unreachable. But with WeakReference, objects that are referenced can be collected.
* Example: C# program that uses WeakReference
using System;
using System.Text;
class Program
{
/// <summary>
/// Points to data that can be garbage collected any time.
/// </summary>
static WeakReference _weak;
static void Main()
{
// Assign the WeakReference.
_weak = new WeakReference(new StringBuilder("perls"));
Reference: http://www.dotnetperls.com/weakreference

Question No : 11
You are developing an application that contains a class named TheaterCustomer and a method named ProcessTheaterCustomer. The ProcessTheaterCustomer() method accepts a TheaterCustomer object as the input parameter.
You have the following requirements:
• Store the TheaterCustomer objects in a collection.
• Ensure that the ProcessTheaterCustomer() method processes the TheaterCustomer objects in the reverse order in which they are placed into the collection.
You need to meet the requirements.
What should you do?

正解:
Explanation:
A stack is the appropriate collection here. In computer science, a stack or LIFO (last in, first out) is an abstract data type that serves as a collection of elements, with two principal operations: push, which adds an element to the collection, and pop, which removes the last element that was added.
Reference: https://en.wikipedia.org/wiki/Stack_(abstract_data_type)

Question No : 12
You need to write a method that retrieves data from a Microsoft Access 2013 database.
The method must meet the following requirements:
• Be read-only.
• Be able to use the data before the entire data set is retrieved.
• Minimize the amount of system overhead and the amount of memory usage.
Which type of object should you use in the method?

正解:
Explanation:
The DbDataReader class reads a forward-only stream of rows from a data source.
Reference: DbDataReader Class
https://msdn.microsoft.com/en-us/library/system.data.common.dbdatareader(v=vs.110).aspx

Question No : 13
You have the following code. (Line numbers are included for reference only).



You need to complete the WriteTextAsync method. The solution must ensure that the code is not blocked while the file is being written.
Which code should you insert at line 12?



正解:
Explanation:
await sourceStream.WriteAsync(encodedText, 0, encodedText.Length);
The following example has the statement await sourceStream.WriteAsync(encodedText, 0, encodedText.Length);, which is a contraction of the following two statements:
Task theTask = sourceStream.WriteAsync(encodedText, 0, encodedText.Length);
await theTask;
Example: The following example writes text to a file. At each await statement, the method immediately exits. When the file I/O is complete, the method resumes at the statement that follows the await statement. Note that the async modifier is in the definition of methods that use the await statement.
public async void ProcessWrite()
{
string filePath = @"temp2.txt";
string text = "Hello World\r\n";
await WriteTextAsync(filePath, text);
}
private async Task WriteTextAsync(string filePath, string text)
{
byte[] encodedText = Encoding.Unicode.GetBytes(text);
using (FileStream sourceStream = new FileStream(filePath,
FileMode.Append, FileAccess.Write, FileShare.None,
bufferSize: 4096, useAsync: true))
{
await sourceStream.WriteAsync(encodedText, 0, encodedText.Length);
};
}
Reference: Using Async for File Access (C# and Visual Basic)
https://msdn.microsoft.com/en-us/library/jj155757.aspx

Question No : 14
DRAG DROP
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: Data Member Order
https://msdn.microsoft.com/en-us/library/ms729813(v=vs.110).aspx
Reference: DataContractAttribute.Namespace Property
https://msdn.microsoft.com/en-us/library/system.runtime.serialization.datacontractattribute.namespace(v=vs.110).aspx

Question No : 15
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?



正解:
Explanation:
Example: All number larger than 15 from a list using the var query = from num in numbers... contstruct:
var largeNumbersQuery = numbers2.Where(c => c > 15);
Reference: How to: Write LINQ Queries in C#
https://msdn.microsoft.com/en-us/library/bb397678.aspx

 / 30