70-483 Premium Bundle

70-483 Premium Bundle

Programming in C# Certification Exam

4.5 
(8085 ratings)
0 QuestionsPractice Tests
0 PDFPrint version
November 23, 2024Last update

Microsoft 70-483 Free Practice Questions

Q1. - (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 

Q2. - (Topic 2) 

You are implementing a method named ProcessFile that retrieves data files from web servers and FTP servers. The ProcessFile () method has the following method signature: 

Public void ProcessFile(Guid dataFileld, string dataFileUri) 

Each time the ProcessFile() method is called, it must retrieve a unique data file and then save the data file to disk. 

You need to complete the implementation of the ProcessFile() method. Which code segment should you use? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:

Explanation: * WebRequest.Create Method (Uri) 

Initializes a new WebRequest instance for the specified URI scheme. 

* Example: 

1. To request data from a host server 

Create a WebRequest instance by calling Create with the URI of the resource. 

C# 

WebRequest request = WebRequest.Create("http://www.contoso.com/"); 

2. Set any property values that you need in the WebRequest. For example, to enable authentication, set the Credentials property to an instance of the NetworkCredential class. 

C# 

request.Credentials = CredentialCache.DefaultCredentials; 

3. To send the request to the server, call GetResponse. The actual type of the returned WebResponse object is determined by the scheme of the requested URI. 

C# 

WebResponse response = request.GetResponse(); 

4. To get the stream containing response data sent by the server, use the GetResponseStream method of the WebResponse. 

C# 

Stream dataStream = response.GetResponseStream (); 

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

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

Q5. - (Topic 2) 

You are developing code for an application that retrieves information about Microsoft .NET Framework assemblies. 

The following code segment is part of the application (line numbers are included for reference only): 

You need to insert code at line 04. The code must load the assembly. Once the assembly is loaded, the code must be able to read the assembly metadata, but the code must be denied access from executing code from the assembly. 

Which code segment should you insert at line 04? 

A. Assembly.ReflectionOnlyLoadFrom(bytes); 

B. Assembly.ReflectionOniyLoad(bytes); 

C. Assembly.Load(bytes); 

D. Assembly.LoadFrom(bytes); 

Answer:

Q6. - (Topic 1) 

You are developing an application. The application includes classes named Employee and Person and an interface named IPerson. 

The Employee class must meet the following requirements: 

. It must either inherit from the Person class or implement the IPerson interface. . It must be inheritable by other classes in the application. 

You need to ensure that the Employee class meets the requirements. 

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: B,D 

Explanation: 

Sealed - When applied to a class, the sealed modifier prevents other classes from inheriting from it. http://msdn.microsoft.com/en-us/library/88c54tsw(v=vs.110).aspx 

Q7. - (Topic 2) 

You are creating an application that reads from a database. 

You need to use different databases during the development phase and the testing phase by using conditional compilation techniques. 

What should you do? 

A. Configure the assembly metadata to use the pre-existing public key for the assembly identity by using the AssemblySignatureKeyAttribute attribute. 

B. Disable the strong-name bypass feature of Microsoft .NET Framework in the registry. 

C. Configure the Define DEBUG constant setting in Microsoft Visual Studio. 

D. Decorate the code by using the [assembly:AssemblyDelaySignAttribute(true)] attribute. 

Answer:

Explanation: Use one debug version to connect to the development database, and a standard version to connect to the live database. 

Q8. - (Topic 2) 

You are developing an application that includes methods named EvaluateLoan, ProcessLoan, and FundLoan. The application defines build configurations named TRIAL, BASIC, and ADVANCED. 

You have the following requirements: 

The TRIAL build configuration must run only the EvaluateLoan() method. 

The BASIC build configuration must run all three methods. 

The ADVANCED build configuration must run only the EvaluateLoan() and 

ProcessLoan() methods. 

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:

Q9. DRAG DROP - (Topic 2) 

You have the following code. 

You need to return all of the products and their associated categories. 

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:  

Q10. - (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 assembly attributes. 

B. Use the csc.exe /target:Library option when building the application. 

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

D. Use the EdmGen.exe command-line tool. 

Answer:

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

* (A) 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 the Assembly Linker (Al.exe) provided by the Windows SDK. 

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

Q11. - (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 csc.exe /target:Library option when building the application. 

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

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

D. Use the EdmGen.exe command-line tool. 

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—it’s 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. 

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

Q13. - (Topic 1) 

You are creating a class named Employee. The class exposes a string property named EmployeeType. The following code segment defines the Employee class. (Line numbers are included for reference only.) 

The EmployeeType property value must be accessed and modified only by code within the Employee class or within a class derived from the Employee class. 

You need to ensure that the implementation of the EmployeeType property meets the requirements. 

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

A. Replace line 05 with the following code segment: protected get; 

B. Replace line 06 with the following code segment: private set; 

C. Replace line 03 with the following code segment: public string EmployeeType 

D. Replace line 05 with the following code segment: private get; 

E. Replace line 03 with the following code segment: protected string EmployeeType 

F. Replace line 06 with the following code segment: protected set; 

Answer: B,E 

Q14. - (Topic 1) 

You are developing an application that will transmit large amounts of data between a client computer and a server. You need to ensure the validity of the data by using a cryptographic hashing algorithm. Which algorithm should you use? 

A. RSA 

B. Aes 

C. HMACSHA256 

D. DES 

Answer:

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

START 70-483 EXAM