Q131. - (Topic 2) 

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? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:

Explanation: The JavaScriptSerializer Class Provides serialization and deserialization functionality for AJAX-enabled applications. 

The JavaScriptSerializer class is used internally by the asynchronous communication layer to serialize and deserialize the data that is passed between the browser and the Web server. You cannot access that instance of the serializer. However, this class exposes a public API. Therefore, you can use the class when you want to work with JavaScript Object Notation (JSON) in managed code. 


Q132. - (Topic 1) 

You are developing a C# application that includes a class named Product. The following code segment defines the Product class: 

You implement System.ComponentModel.DataAnnotations.IValidateableObject interface to provide a way to validate the Product object. 

The Product object has the following requirements: 

. The Id property must have a value greater than zero. 

. The Name property must have a value other than empty or null. You need to validate the Product object. Which code segment should you use? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:


Q133. - (Topic 2) 

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? 

A. DbDataReader 

B. DataContext 

C. unTyped DataSet 

D. DbDataAdapter 

Answer:

Explanation: DbDataReader Class 

Reads a forward-only stream of rows from a data source. 


Q134. - (Topic 2) 

You are developing an application that will process personnel records. 

The application must encrypt highly sensitive data. 

You need to ensure that the application uses the strongest available encryption. 

Which class should you use? 

A. System.Security.Cryptography.DES 

B. System.Security.Cryptography.Aes 

C. System.Security.Cryptography.TripleDES 

D. System.Security.Cryptography.RC2 

Answer:


Q135. - (Topic 1) 

You are implementing a method named Calculate that performs conversions between value types and reference types. The following code segment implements the method. (Line numbers are included for reference only.) 

You need to ensure that the application does not throw exceptions on invalid conversions. 

Which code segment should you insert at line 04? 

A. int balance = (int) (float)amountRef; 

B. int balance = (int)amountRef; 

C. int balance = amountRef; 

D. int balance = (int) (double) amountRef; 

Answer:


Q136. DRAG DROP - (Topic 2) 

You have an application that uses paging. Each page displays 10 items from a list. 

You need to display the third page. (Develop the solution by selecting and ordering the required code snippets. You may not need all of the code snippets.) 

Answer: 


Q137. - (Topic 2) 

You are creating a class library that will be used in a web application. 

You need to ensure that the class library assembly is strongly named. 

What should you do? 

A. Use the gacutil.exe command-line tool. 

B. Use the xsd.exe command-line tool. 

C. Use the aspnet_regiis.exe command-line tool. 

D. Use assembly attributes. 

Answer:

Explanation: The Windows Software Development Kit (SDK) provides several ways to sign an assembly with a strong name: 

* Using the Assembly Linker (Al.exe) provided by the Windows SDK. 

* Using assembly attributes to insert the strong name information in your code. You can use either the AssemblyKeyFileAttribute or the AssemblyKeyNameAttribute, depending on where the key file to be used is located. 

* Using compiler options such /keyfile or /delaysign in C# and Visual Basic, or the 

/KEYFILE or /DELAYSIGN linker option in C++. (For information on delay signing, see 

Delay Signing an Assembly.) 

Note: 

* A strong name consists of the assembly's identity—its simple text name, version number, and culture information (if provided)—plus a public key and a digital signature. It is generated from an assembly file (the file that contains the assembly manifest, which in turn contains the names and hashes of all the files that make up the assembly), using the corresponding private key. Microsoft. Visual Studio. .NET and other development tools provided in the .NET Framework SDK can assign strong names to an assembly. 

Assemblies with the same strong name are expected to be identical. 


Q138. - (Topic 2) 

You are developing an application that includes a class named Employee and a generic list 

of employees. The following code segment declares the list of employees: 

List<Employee> employeesList = new List<Employee>(); 

You populate the employeesList object with several hundred Employee objects. 

The application must display the data for five Employee objects at a time. 

You need to create a method that will return the correct number of Employee objects. 

Which code segment should you use? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:


Q139. - (Topic 1) 

You are developing an application that includes a class named UserTracker. The application includes the following code segment. (Line numbers are included for reference only.) 

You need to add a user to the UserTracker instance. What should you do? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:


Q140. - (Topic 2) 

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? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:

Explanation: Simply use float for the TransferFunds parameter. 

Note: 

* The float keyword signifies a simple type that stores 32-bit floating-point values. 

* The double keyword signifies a simple type that stores 64-bit floating-point values