70-483 Premium Bundle

70-483 Premium Bundle

Programming in C# Certification Exam

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

Microsoft 70-483 Free Practice Questions

Q1. - (Topic 1) 

You are creating a class named Game. 

The Game class must meet the following requirements: 

Include a member that represents the score for a Game instance. 

Allow external code to assign a value to the score member. 

Restrict the range of values that can be assigned to the score member. 

You need to implement the score member to meet the requirements. 

In which form should you implement the score member? 

A. protected field 

B. public static field 

C. public static property 

D. public property 

Answer:

Q2. - (Topic 2) 

You are developing an application that will manage customer records. The application includes a method named FindCustomer. 

Users must be able to locate customer records by using the customer identifier or customer name. 

You need to implement the FindCustomer() method to meet the requirement. 

Which two sets of method signatures 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 

Q3. - (Topic 1) 

An application includes a class named Person. The Person class includes a method named GetData. 

You need to ensure that the GetData() from the Person class. 

Which access modifier should you use for the GetData() method? 

A. Internal 

B. Protected 

C. Private 

D. Protected internal 

E. Public 

Answer:

Explanation: 

Protected - The type or member can be accessed only by code in the same class or structure, or in a class that is derived from that class. http://msdn.microsoft.com/en-us/library/ms173121.aspx The protected keyword is a member access modifier. A protected member is accessible within its class and by derived class instances. 

Q4. - (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 reverse order in which they are placed into the collection. 

You need to meet the requirements. 

What should you do? 

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

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

C. Create a System.Collections.Stack collection. Use the Push() method to add TheaterCustomer objects to the collection. Use the Pop() method to pass the objects to the ProcessTheaterCustomer() method. 

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

Answer:

Explanation: A stack is the appropriate collection here. In computer science, a stack or LIFO (last in, first out) is an abstract data type that serves as a collection of elements, with two principal operations: push, which adds an element to the collection, and pop, which removes the last element that was added. 

Reference: https://en.wikipedia.org/wiki/Stack_(abstract_data_type) 

Q5. - (Topic 2) 

You have an application that accesses a Web server named Server1. 

You need to download an image named Imagel.jpg from Server1 and store the image locally as Filel.jpg. 

Which code should you use? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:

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. 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 AdventureWorksValidationException exceptions are caught, log the information by using the static void Log (AdventureWorksValidationException ex) method. 

. When AdventureWorksDbException or other AdventureWorksException exceptions are caught, log the information by using the static void I oq( AdventureWorksException 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:  

Q8. - (Topic 2) 

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

You need to ensure that the DoWork(Widget widget) method runs. 

With which code segment should you replace line 24? 

A. DoWork((Widget)o); 

B. DoWork(new Widget(o)); 

C. DoWork(o is Widget); 

D. DoWork((ItemBase)o); 

Answer:

Q9. - (Topic 2) 

An application uses X509 certificates for data encryption and decryption. The application stores certificates in the Personal certificates collection of the Current User store. On each computer, each certificate subject is unique. 

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

The LoadCertificate() method must load only certificates for which the subject exactly matches the searchValue parameter value. 

You need to ensure that the LoadCertificate() method loads the correct certificates. 

Which code segment should you insert at line 06? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:

Q10. - (Topic 2) 

You are implementing a method named GetValidPhoneNumbers. The GetValidPhoneNumbers() method processes a list of string values that represent phone numbers. 

The GetValidPhoneNumbers() method must return only phone numbers that are in a valid format. 

You need to implement the GetValidPhoneNumbers() method. 

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

Explanation: * Regex.Matches Searches an input string for all occurrences of a regular expression and returns all the matches. 

* MatchCollection 

Represents the set of successful matches found by iteratively applying a regular 

expression pattern to the input string. 

The collection is immutable (read-only) and has no public constructor. The Regex.Matches 

method returns a MatchCollection object. 

* List<T>.Add Method 

Adds an object to the end of the List<T>. 

Q11. - (Topic 1) 

You are creating a console application named App1. 

App1 retrieves data from the Internet by using JavaScript Object Notation (JSON). 

You are developing the following code segment (line numbers are included for reference only): 

You need to ensure that the code validates the JSON string. 

Which code should you insert at line 03? 

A. DataContractSerializer serializer = new DataContractSerializer(); 

B. var serializer = new DataContractSerializer(); 

C. XmlSerlalizer serializer = new XmlSerlalizer(); 

D. var serializer = new JavaScriptSerializer(); 

Answer:

Explanation: The JavaScriptSerializer Class Provides serialization and deserialization functionality for AJAX-enabled applications. 

The JavaScriptSerializer class is used internally by the asynchronous communication layer to serialize and deserialize the data that is passed between the browser and the Web server. You cannot access that instance of the serializer. However, this class exposes a public API. Therefore, you can use the class when you want to work with JavaScript Object Notation (JSON) in managed code. 

Q12. - (Topic 1) 

You are developing an application that uses structured exception handling. The application includes a class named Logger. The Logger class implements a method named Log by using the following code segment: 

public static void Log(Exception ex) { } 

You have the following requirements: 

. Log all exceptions by using the Log() method of the Logger 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:

Q13. DRAG DROP - (Topic 2) 

You are creating a class named Data that includes a dictionary object named _data. 

You need to allow the garbage collection process to collect the references of the _data object. 

You have the following code: 

Which code segments should you include in Target 1 and Target 2 to complete the 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:  

Q14. - (Topic 1) 

You are developing an application that includes a class named BookTracker for tracking library books. The application includes the following code segment. (Line numbers are included for reference only.) 

You need to add a user to the BookTracker instance. What should you do? A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:

Q15. DRAG DROP - (Topic 2) 

You are creating a method that will split a single input file into two smaller output files. 

The method must perform the following actions: 

. Create a file named header.dat that contains the first 20 bytes of the input file. 

. Create a file named body.dat that contains the remainder of the input file. 

You need to create the method. 

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:  

START 70-483 EXAM