70-483 Premium Bundle

70-483 Premium Bundle

Programming in C# Certification Exam

4.5 
(26040 ratings)
0 QuestionsPractice Tests
0 PDFPrint version
December 3, 2024Last update

Microsoft 70-483 Free Practice Questions

Q1. DRAG DROP - (Topic 1) 

You are developing a class named ExtensionMethods. 

You need to ensure that the ExtensionMethods class implements the IsEmail() extension method on string objects. 

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:  

Q2. - (Topic 2) 

You are developing an application that uses a .config file. 

The relevant portion of the .config file is shown as follows: 

You need to ensure that diagnostic data for the application writes to the event log by using the configuration specified in the .config file. 

What should you include in the application code? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:

Explanation: Explanation 

http://msdn.microsoft.com/en-us/library/vstudio/system.diagnostics.eventlogtracelistener 

Public static void Main(string[] args) { 

Create a trace listener for the event log. 

EventLogTraceListener myTraceListener = new 

EventLogTraceListener("myEventLogSource"); 

Add the event log trace listener to the collection. 

Trace.Listeners.Add(myTraceListener); 

// Write output to the event log. 

Trace.WriteLine("Test output"); 

Q3. DRAG DROP - (Topic 1) 

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.) 

Answer:  

Q4. - (Topic 2) 

You are developing an application that will be deployed to multiple computers. You set the assembly name. 

You need to create a unique identity for the application assembly. 

Which two assembly identity attributes should you include in the source code? (Each correct answer presents part of the solution. Choose two.) 

A. AssemblyDelaySignAttribute 

B. AssemblyCompanyAttribute 

C. AssemblyProductAttribute 

D. AssemblyCultureAttribute 

E. AssemblyVersionAttribute 

Answer: D,E 

Explanation: The AssemblyName object contains information about an assembly, which 

you can use to bind to that assembly. An assembly's identity consists of the following: 

Simple name. 

Version number. 

Cryptographic key pair. 

Supported culture. 

D: AssemblyCultureAttribute 

Specifies which culture the assembly supports. 

The attribute is used by compilers to distinguish between a main assembly and a satellite 

assembly. A main assembly contains code and the neutral culture's resources. A satellite 

assembly contains only resources for a particular culture, as in 

[assembly:AssemblyCultureAttribute("de")] 

E: AssemblyVersionAttribute 

Specifies the version of the assembly being attributed. 

The assembly version number is part of an assembly's identity and plays a key part in 

binding to the assembly and in version policy. 

Q5. - (Topic 1) 

You are developing an application. The application converts a Location object to a string by using a method named WriteObject. The WriteObject() method accepts two parameters, a Location object and an XmlObjectSerializer object. 

The application includes the following code. (Line numbers are included for reference only.) 

You need to serialize the Location object as a JSON object. 

Which code segment should you insert at line 20? 

A. New DataContractSerializer(typeof(Location)) 

B. New XmlSerializer(typeof(Location)) 

C. New NetDataContractSenalizer() 

D. New DataContractJsonSerializer(typeof(Location)) 

Answer:

Explanation: 

The DataContractJsonSerializer class serializes objects to the JavaScript Object Notation 

(JSON) and deserializes JSON data to objects. 

Use the DataContractJsonSerializer class to serialize instances of a type into a JSON 

document and to deserialize a JSON document into an instance of a type. 

Q6. HOTSPOT - (Topic 2) 

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. 

Answer:  

Q7. - (Topic 2) 

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? 

A. 01 

B. 03 

C. 05 

D. 07 

Answer:

Q8. - (Topic 2) 

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? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:

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 

Q9. DRAG DROP - (Topic 2) 

You create an assembly named Assembly1.dll. 

You need to ensure that Assembly1.dll can be deployed to the global assembly cache (GAC). 

Which commands should you run? (To answer, drag the appropriate programs to the correct locations. Each program 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:  

Q10. DRAG DROP - (Topic 1) 

You are developing an application that will populate an extensive XML tree from a Microsoft SQL Server 2008 R2 database table named Contacts. 

You are creating the XML tree. The solution must meet the following requirements: . Minimize memory requirements. . Maximize data processing speed. You open the database connection. You need to create the XML tree. 

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:  

Q11. - (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:

Q12. DRAG DROP - (Topic 2) 

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 { 

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.) 

Answer:  

Q13. - (Topic 2) 

You are developing a method named GenerateHash that will create the hash value for a file. The method includes the following code. (Line numbers are included for reference only.) 

You need to return the cryptographic hash of the bytes contained in the fileBuffer variable. Which code segment should you insert at line 05? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:

Q14. - (Topic 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? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:

Explanation: When the C# compiler encounters an #if directive, followed eventually by an #endif directive, it will compile the code between the directives only if the specified symbol is defined. Unlike C and C++, you cannot assign a numeric value to a symbol; the #if statement in C# is Boolean and only tests whether the symbol has been defined or not. For example, #define DEBUG // ... #if DEBUG Console.WriteLine("Debug version"); #endif 

Q15. - (Topic 2) 

You are debugging a 64-bit C# application. 

Users report System.OutOfMemoryException exceptions. The system is attempting to use arrays larger than 2 GB in size. 

You need to ensure that the application can use arrays larger than 2 GB. 

What should you do? 

A. Add the /3GB switch to the boot.ini file for the operating system. 

B. Set the IMAGE_FILE_LARGE_ADDRESS_AWARE flag in the image header for the application executable file. 

C. Set the value of the gcAllowVeryLargeObjects property to true in the application configuration file. 

D. Set the value of the user-mode virtual address space setting for the operating system to MAX. 

Answer:

START 70-483 EXAM