70-483 Premium Bundle

70-483 Premium Bundle

Programming in C# Certification Exam

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

Microsoft 70-483 Free Practice Questions

Q1. - (Topic 2) 

You are developing a class named Scorecard. The following code implements the Scorecard class. (Line numbers are included for reference only.) 

You create the following unit test method to test the Scorecard class implementation: 

You need to ensure that the unit test will pass. What should you do? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:

Q2. - (Topic 1) 

You are creating an application that manages information about your company's products. The application includes a class named Product and a method named Save. 

The Save() method must be strongly typed. It must allow only types inherited from the Product class that use a constructor that accepts no parameters. 

You need to implement the Save() method. Which code segment should you use? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:

Q3. 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:  

Q4. 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:  

Q5. DRAG DROP - (Topic 1) 

You are developing an application that includes a class named Warehouse. The Warehouse class includes a static property named Inventory- The Warehouse class is defined by the following code segment. (Line numbers are included for reference only.) 

You have the following requirements: 

Initialize the _inventory field to an Inventory instance. 

Initialize the _inventory field only once. 

Ensure that the application code acquires a lock only when the _inventory object must be instantiated. 

You need to meet the requirements. 

Which three code segments should you insert in sequence at line 09? (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:  

Q6. DRAG DROP - (Topic 1) 

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. 

You have the following requirements: 

. The CalculateInterest() method must run for all build configurations. 

. The LogLine() method must be called only for debug builds. 

You need to ensure that the methods run correctly. 

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:  

Q7. - (Topic 1) 

You are developing an assembly that will be used by multiple applications. 

You need to install the assembly in the Global Assembly Cache (GAC). 

Which two actions can you perform to achieve this goal? (Each correct answer presents a complete solution. Choose two.) 

A. Use the Assembly Registration tool (regasm.exe) to register the assembly and to copy the assembly to the GAC. 

B. Use the Strong Name tool (sn.exe) to copy the assembly into the GAC. 

C. Use Microsoft Register Server (regsvr32.exe) to add the assembly to the GAC. 

D. Use the Global Assembly Cache tool (gacutil.exe) to add the assembly to the GAC. 

E. Use Windows Installer 2.0 to add the assembly to the GAC. 

Answer: D,E 

Explanation: 

There are two ways to deploy an assembly into the global assembly cache: 

Use an installer designed to work with the global assembly cache. This is the preferred option for installing assemblies into the global assembly cache. 

Use a developer tool called the Global Assembly Cache tool (Gacutil.exe), provided by the 

Windows 

Software Development Kit (SDK). 

Note: 

In deployment scenarios, use Windows Installer 2.0 to install assemblies into the global assembly cache. Use the Global Assembly Cache tool only in development scenarios, because it does not provide assembly reference counting and other features provided when using the Windows Installer. 

http://msdn.microsoft.com/en-us/library/yf1d93sz%28v=vs.110%29.aspx 

Q8. - (Topic 1) 

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:

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/en-us/library/f02979c7.aspx 

Q9. - (Topic 2) 

You have an application that will send confidential information to a Web server. 

You need to ensure that the data is encrypted when it is sent across the network. 

Which class should you use? 

A. CryptoStream 

B. AuthenticatedStream 

C. PipeStream 

D. NegotiateStream 

Answer:

Q10. - (Topic 2) 

You are developing an application. 

You need to declare a delegate for a method that accepts an integer as a parameter, and then returns an integer. 

Which type of delegate should you use? 

A. Action<int> 

B. Action<int, int> 

C. Func<int, int> 

D. Func<int> 

Answer:

Q11. - (Topic 2) 

You are developing an assembly. 

You plan to sign the assembly when the assembly is developed. 

You need to reserve space in the assembly for the signature. 

What should you do? 

A. Run the Assembly Linker tool from the Windows Software Development Kit (Windows SDK). 

B. Run the Strong Name tool from the Windows Software Development Kit (Windows SDK). 

C. Add the AssemblySignatureKeyAttribute attribute the assembly. 

D. Add the AssemblyDelaySignAttribute attribute to the assembly. 

Answer:

Q12. - (Topic 1) 

An application receives JSON data in the following format: 

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

You need to ensure that the ConvertToName() method returns the JSON input string as a Name object. 

Which code segment should you insert at line 10? 

A. Return ser.Desenalize (json, typeof(Name)); 

B. Return ser.ConvertToType<Name>(json); 

C. Return ser.Deserialize<Name>(json); 

D. Return ser.ConvertToType (json, typeof (Name)); 

Answer:

Q13. DRAG DROP - (Topic 2) 

You are developing a C# application. The application includes a class named Rate. The following code segment implements the Rate class: 

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:  

Q14. - (Topic 2) 

You are developing an application that includes a method named SendMessage. 

You need to ensure that the SendMessage() method is called with the required parameters. 

Which two code segments can you use to achieve this goal? (Each correct answer presents a complete solution. Choose two.) 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer: C,D 

Explanation: D: ExpandoObject Represents an object whose members can be dynamically added and removed at run time. / The ExpandoObject class enables you to add and delete members of its instances at run time and also to set and get values of these members. This class supports dynamic binding, which enables you to use standard syntax like sampleObject.sampleMember instead of more complex syntax like sampleObject.GetAttribute("sampleMember"). / You can pass instances of the ExpandoObject class as parameters. Note that these instances are treated as dynamic objects in C# and late-bound objects in Visual Basic. This means that you do not have IntelliSense for object members and you do not receive compiler errors when you call non-existent members. If you call a member that does not exist, an exception occurs. 

Note: 

* Visual C# 2010 introduces a new type, dynamic. The type is a static type, but an object of type dynamic bypasses static type checking. In most cases, it functions like it has type object. At compile time, an element that is typed as dynamic is assumed to support any operation. Therefore, you do not have to be concerned about whether the object gets its value from a COM API, from a dynamic language such as IronPython, from the HTML Document Object Model (DOM), from reflection, or from somewhere else in the program. However, if the code is not valid, errors are caught at run time. 

Q15. - (Topic 1) 

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:

START 70-483 EXAM