70-483 Premium Bundle

70-483 Premium Bundle

Programming in C# Certification Exam

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

Microsoft 70-483 Free Practice Questions

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

Q2. - (Topic 2) 

You are troubleshooting an application that uses a class named FullName. The class is decorated with the DataContractAttribute attribute. The application includes the following code. (Line numbers are included for reference only.) 

You need to ensure that the entire FullName object is serialized to the memory stream object. 

Which code segment should you insert at line 09? 

A. binary.WriteEndDocument(); 

B. binary.WriteEndDocumentAsync(); 

C. binary.WriteEndElementAsync(); 

D. binary.Flush(); 

Answer:

Explanation: * DataContractSerializer.WriteEndObject Method (XmlDictionaryWriter) Writes the closing XML element using an XmlDictionaryWriter. 

* Note on line 07: DataContractSerializer.WriteObject Method Writes all the object data (starting XML element, content, and closing element) to an XML document or stream. 

XmlDictionaryWriter 

Q3. - (Topic 2) 

You are developing an application that contains a class named TheaterCustomer and a method named ProcessTheaterCustomer. The ProcessTheaterCustomer() method accepts a TheaterCustomer object as the input parameter. 

You have the following requirements: 

. Store the TheaterCustomer objects in a collection. . Ensure that the ProcessTheaterCustomer() method processes the TheaterCustomer objects in the order in which they are placed into the collection. 

You need to meet the requirements. 

What should you do? 

A. Create a System.Collections.Stack collection. Use the Push() method to add TheaterCustomer objects to the collection, Use the Peek() method to pass the objects to the ProcessTheaterCustomer() method. 

B. Create a System.Collections.Queue collection. Use the Enqueue() method to add TheaterCustomer objects to the collection. Use the Dequeue() method to pass the objects to the ProcessTheaterCustomer() method. 

C. Create a System.Collections.SortedList collection. Use the Add() method to add TheaterCustomer objects to the collection. Use the Remove() method to pass the objects to the ProcessTheaterCustomer() method. 

D. Create a System.Collections.ArrayList collection. Use the Insert() method to add TheaterCustomer objects to the collection. Use the Remove() method to pass the objects to the ProcessTheaterCustomer() method. 

Answer:

Q4. DRAG DROP - (Topic 1) 

You are developing an application that includes a class named Customer. 

The application will output the Customer class as a structured XML document by using the following code segment: 

You need to ensure that the Customer class will serialize to XML. 

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:  

Q5. DRAG DROP - (Topic 1) 

You are developing an application that implements a set of custom exception types. You declare the custom exception types by using the following code segments: 

The application includes a function named DoWork that throws .NET Framework exceptions and custom exceptions. The application contains only the following logging methods: 

The application must meet the following requirements: 

. When ContosoValidationException exceptions are caught, log the information by using the static void Log (ContosoValidationException ex) method. . When ContosoDbException or other ContosoException exceptions are caught, log the information by using the static void Log(ContosoException ex) method. 

You need to meet the requirements. 

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:  

Q6. - (Topic 2) 

You are modifying an existing application. 

The application includes a Loan class and a Customer class. The following code segment defines the classes. 

You populate a collection named customer-Collection with Customer and Loan objects by using the following code segment: 

You create a largeCustomerLoans collection to store the Loan objects by using the following code segment: 

Collection<Loan> largeCustomerLoans = new Collection<Loan>(); 

All loans with an Amount value greater than or equal to 4000 must be tracked. 

You need to populate the largeCustomerLoans collection with Loan objects. 

Which code segment should you use? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:

Explanation: Must add to the largeCustomerLoans collection, not the customerLoanCollection. 

We iterate through each customer in customerCollection and check each loan belonging to this customer. 

Q7. - (Topic 2) 

You are modifying an application that processes loans. The following code defines the Loan class. (Line numbers are included for reference only.) 

Loans are restricted to a maximum term of 10 years. The application must send a notification message if a loan request exceeds 10 years. 

You need to implement the notification mechanism. 

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

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer: B,D 

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

Q9. - (Topic 2) 

You are developing an application that includes the following code segment: 

You need to implement both Start() methods in a derived class named UseStart that uses the Start() method of each interface. 

Which two code segments should you use? (Each correct answer presents part of the solution. Choose two.) 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

E. Option E 

F. Option F 

Answer: B,E 

Explanation: B: 

* Implementing Multiple Interfaces 

A class can implement multiple interfaces using the following syntax: 

C# 

public class CDAndDVDComboPlayer : ICDPlayer, IDVDPlayer 

If a class implements more than one interface where there is ambiguity in the names of members, it is resolved using the full qualifier for the property or method name. In other words, the derived class can resolve the conflict by using the fully qualified name for the method to indicate to which interface it belongs 

* In C#, both inheritance and interface implementation are defined by the : operator, equivalent to extends and implements in Java. The base class should always be leftmost in the class declaration. 

Q10. DRAG DROP - (Topic 1) 

You are developing a custom collection named LoanCollection for a class named Loan class. 

You need to ensure that you can process each Loan object in the LoanCollection collection by using a foreach loop. 

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

Q12. - (Topic 2) 

You are developing a method named GetHash that will return a 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 fileBytes variable. Which code segment should you insert at line 05? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:

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

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

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

START 70-483 EXAM