70-483 Premium Bundle

70-483 Premium Bundle

Programming in C# Certification Exam

4.5 
(35190 ratings)
0 QuestionsPractice Tests
0 PDFPrint version
November 21, 2024Last update

Microsoft 70-483 Free Practice Questions

Q1. 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 entire 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:  

Q2. HOTSPOT - (Topic 2) 

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. 

Answer:  

Q3. - (Topic 1) 

You are developing an application that includes a class named Order. The application will store a collection of Order objects. 

The collection must meet the following requirements: 

Use strongly typed members. 

Process Order objects in first-in-first-out order. 

Store values for each Order object. 

. Use zero-based indices. 

You need to use a collection type that meets the requirements. 

Which collection type should you use? 

A. Queue<T> 

B. SortedList 

C. LinkedList<T> 

D. HashTable 

E. Array<T> 

Answer:

Explanation: 

Queues are useful for storing messages in the order they were received for sequential processing. Objects stored in a Queue<T> are inserted at one end and removed from the other. http://msdn.microsoft.com/en-us/library/7977ey2c.aspx 

Q4. HOTSPOT - (Topic 1) 

You are developing an application that includes a Windows Communication Foundation (WCF) service. The service includes a custom TraceSource object named ts and a method named DoWork. The application must meet the following requirements: 

. Collect trace information when the DoWork() method executes. . Group all traces for a single execution of the DoWork() method as an activity that can be viewed in the WCF Service Trace Viewer Tool. 

You need to ensure that the application meets the requirements. 

How should you complete the relevant code? (To answer, select the correct code segment from each drop-down list in the answer area.) 

Answer:  

Q5. - (Topic 1) 

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

The GetAnimals() method must meet the following requirements: 

Connect to a Microsoft SQL Server database. 

Create Animal objects and populate them with data from the database. 

Return a sequence of populated Animal objects. 

You need to meet the requirements. 

Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.) 

A. Insert the following code segment at line 16: while(sqlDataReader.NextResult()) 

B. Insert the following code segment at line 13: sqlConnection.Open(); 

C. Insert the following code segment at line 13: sqlConnection.BeginTransaction(); 

D. Insert the following code segment at line 16: while(sqlDataReader.Read()) 

E. Insert the following code segment at line 16: while(sqlDataReader.GetValues()) 

Answer: B,D 

Explanation: 

SqlConnection.Open - Opens a database connection with the property settings specified by the ConnectionString. http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.open.aspx SqlDataReader.Read - Advances the SqlDataReader to the next record. http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqldatareader.read.aspx 

Q6. - (Topic 2) 

You are developing an application that will parse a large amount of text. 

You need to parse the text into separate lines and minimize memory use while processing data. 

Which object type should you use? 

A. DataContractSerializer 

B. StringBuilder 

C. StringReader 

D. JsonSerializer 

Answer:

Q7. HOTSPOT - (Topic 1) 

You are developing an application in C#. 

The application will display the temperature and the time at which the temperature was recorded. You have the following method (line numbers are included for reference only): 

You need to ensure that the message displayed in the lblMessage object shows the time formatted according to the following requirements: 

The time must be formatted as hour:minute AM/PM, for example 2:00 PM. 

The date must be formatted as month/day/year, for example 04/21/2013. 

The temperature must be formatted to have two decimal places, for example 23-

45. 

Which code should you insert at line 04? (To answer, select the appropriate options in the answer area.) 

Answer:  

Q8. - (Topic 2) 

You are creating an application that processes a list of numbers. 

The application must define a method that queries the list and displays a subset of the 

numbers to the user. The method must not update the list. 

You need to create an extendable query by using LINQ. 

What should you do? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:

Q9. - (Topic 1) 

You are developing an application that uses structured exception handling. The application includes a class named ExceptionLogger. 

The ExceptionLogger class implements a method named LogException by using the following code segment: 

public static void LogException(Exception ex) 

You have the following requirements: . Log all exceptions by using the LogException() method of the ExceptionLogger class. . Rethrow the original exception, including the entire exception stack. You need to meet the requirements. 

Which code segment should you use? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:

Explanation: 

Once an exception is thrown, part of the information it carries is the stack trace. The stack trace is a list of the method call hierarchy that starts with the method that throws the exception and ends with the method that catches the exception. If an exception is re-thrown by specifying the exception in the throw statement, the stack trace is restarted at the current method and the list of method calls between the original method that threw the exception and the current method is lost. To keep the original stack trace information with the exception, use the throw statement without specifying the exception. 

http://msdn.microsoft.com/en-us/library/ms182363(v=vs.110).aspx 

Q10. DRAG DROP - (Topic 2) 

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

Answer:  

Q11. HOTSPOT - (Topic 1) 

You have the following code: To answer, complete each statement according to the information presented in the code. 

Answer:  

Q12. DRAG DROP - (Topic 2) 

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. 

Answer:  

Q13. - (Topic 1) 

You are creating a console application by using C#. 

You need to access the application assembly. 

Which code segment should you use? 

A. Assembly.GetAssembly(this); 

B. this.GetType(); 

C. Assembly.Load(); 

D. Assembly.GetExecutingAssembly(); 

Answer:

Explanation: 

Assembly.GetExecutingAssembly - Gets the assembly that contains the code that is currently executing. http://msdn.microsoft.com/en-us/library/system.reflection.assembly.getexecutingassembly(v=vs.110).aspx 

Assembly.GetAssembly - Gets the currently loaded assembly in which the specified class is defined. http://msdn.microsoft.com/en-us/library/system.reflection.assembly.getassembly.aspx 

Q14. - (Topic 1) 

You are adding a public method named UpdateScore to a public class named ScoreCard. 

The code region that updates the score field must meet the following requirements: . It must be accessed by only one thread at a time. . It must not be vulnerable to a deadlock situation. You need to implement the UpdateScore() method. 

What should you do? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:

Explanation: 

http://blogs.msdn.com/b/bclteam/archive/2004/01/20/60719.aspx 

Q15. - (Topic 1) 

You are developing an application that will process orders. The debug and release versions of the application will display different logo images. 

You need to ensure that the correct image path is set based on the build configuration. Which code segment should you use? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:

Explanation: 

There is no such constraint (unless you define one explicitly) RELEASE. http://stackoverflow.com/questions/507704/will-if-release-work-like-if-debug-does-in-c 

START 70-483 EXAM