70 483
70 483
70 483
http://www.itcertmaster.com
IT Certification Guaranteed, The Easy Way!
Exam
70-483
Title
Programming in C#
Vendor
Microsoft
Version
DEMO
NO.1 You are developing an application by using C#. The application includes the following code
segment. (Line numbers are included for reference only.)
The DoWork() method must throw an InvalidCastException exception if the obj object is not of type
IDataContainer 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. var dataContainer = obj as IDataContainer;
C. var dataContainer = obj is IDataContainer;
D. dynamic dataContainer = obj;
Answer: A
Explanation:
http://msdn.microsoft.com/en-us/library/ms173105.aspx
NO.2 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?
A. WaitForFullGCComplete()
B. SuppressFinalize()
C. WaitForFullGCApproach()
D. WaitForPendingFinalizers()
Answer: B
NO.3 You need to create a method that can be called by using a varying number of parameters.
What should you use?
A. derived classes
B. interface
C. enumeration
D. method overloading
Answer: D
Explanation:
Member overloading means creating two or more members on the same type that differ only in the
number or type of parameters but have the same name. Overloading is one of the most important
techniques for improving usability, productivity, and readability of reusable libraries. Overloading on
the number of parameters makes it possible to provide simpler versions of constructors and
methods. Overloading on the parameter type makes it possible to use the same member name for
members performing identical operations on a selected set of different types.
NO.4 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.)
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.)
4
Answer:
NO.6 You plan to store passwords in a Windows Azure SQL Database database.
You need to ensure that the passwords are stored in the database by using a hash algorithm,
Which cryptographic algorithm should you use?
A. ECDSA
B. RSA-768
C. AES-256
D. SHA-256
Answer: D
NO.7 You are developing a C# application. The application includes the following code segment, (Line
numbers are included for reference only.)
The application fails at line 17 with the following error message: "An item with the same key
has already been added."
You need to resolve the error.
Which code segment should you insert at line 16?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: A
NO.8 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
6
You define a collection of rates named rateCollection by using the following code segment:
Collection<Rate> rateCollection = new Collection<Rate>() ;
The application receives an XML file that contains rate information in the following format:
You need to parse the XML file and populate the rateCollection collection with Rate objects.
You have the following code: Which code segments should you include in Target 1, Target 2, Target 3
and Target 4 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.)
Answer:
NO.11 You are developing code for a class named Account. The Account class includes the following
method:
You need to ensure that overflow exceptions are thrown when there is an error.
Which type of block should you use?
A. checked
B. try
C. using
D. unchecked
Answer: A
NO.12 You are modifying an existing banking application.
The application includes an Account class and a Customer class. The following code segment defines
the classes.
You populate a collection named customerCollection with Customer and Account objects by using the
following code segment:
You create a largeCustomerAccounts collection to store the Account objects by using the
following code segment:
A. Option A
B. Option B
C. Option C
D. Option D
10
Answer: C
NO.13 You are developing an application that includes the following code segment. (Line numbers
are included for reference only.)
You need to ensure that the application accepts only integer input and prompts the user each time
non-integer input is entered.
Which code segment should you add at line 19?
A. If (!int.TryParse(sLine, out number))
B. If ((number = Int32.Parse(sLine)) == Single.NaN)
C. If ((number = int.Parse(sLine)) > Int32.MaxValue)
D. If (Int32.TryParse(sLine, out number))
Answer: A
Explanation:
B and C will throw exception when user enters non-integer value. D is exactly the opposite what we
want to achieve.
Int32.TryParse - Converts the string representation of a number to its 32-bit signed integer equivalent.
A return value indicates whether the conversion succeeded. http://msdn.microsoft.com/enus/library/f02979c7.aspx
NO.14 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.
11
- Minimize the amount of system overhead and the amount of memory usage.
Which type of object should you use in the method?
A. DbDataAdapter
B. unTyped DataSet
C. OleDbDataAdapter
D. DbDataReader
Answer: D
Explanation:
The DbDataReader class reads a forward-only stream of rows from a data source.
Reference: DbDataReader Class
https://msdn.microsoft.com/enus/library/system.data.common.dbdatareader(v=vs.110).aspx
NO.15 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.)
Answer:
12
A. Option A
B. Option B
C. Option C
13
D. Option D
Answer: B
Explanation:
* Regex.IsMatch Method (String, String)
Indicates whether the specified regular expression finds a match in the specified input
string.
Syntax:
public static bool IsMatch(
string input,
string pattern
)
14