Proper study guides for Up to the immediate present Microsoft Programming in C# certified begins with Microsoft 70 483 exam preparation products which designed to deliver the Certified exam 70 483 questions by making you pass the 70 483 programming in c# test at your first time. Try the free 70 483 exam demo right now.
Q121. - (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. RemoveMemoryPressure()
B. ReRegisterForFinalize()
C. WaitForFullGCComplete()
D. KeepAlive()
Answer: D
Q122. - (Topic 1)
You are modifying an application that processes leases. The following code defines the Lease class. (Line numbers are included for reference only.)
Leases are restricted to a maximum term of 5 years. The application must send a notification message if a lease request exceeds 5 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
E. Option E
F. Option F
Answer: A,B
Q123. - (Topic 2)
You are modifying an existing application that manages employee payroll. The application includes a class named PayrollProcessor. The PayrollProcessor class connects to a payroll database and processes batches of paychecks once a week.
You need to ensure that the PayrollProcessor class supports iteration and releases database connections after the batch processing completes.
Which two interfaces should you implement? (Each correct answer presents part of the complete solution. Choose two.)
A. IEquatable
B. IEnumerable
C. IDisposable
D. IComparable
Answer: B,C
Explanation: IEnumerable IDisposable Interface Exposes an enumerator, which supports a simple iteration over a non-generic collection.
Defines a method to release allocated resources.
The primary use of this interface is to release unmanaged resources.
Q124. - (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: D
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 ();
Q125. - (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: B
Q126. - (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: D
Q127. - (Topic 2)
You are evaluating a method that calculates loan interest. The application includes the following code segment. (Line numbers are included for reference only.)
When the loanTerm value is 5 and the loanAmount value is 4500, the loanRate must be set to 6.5 percent.
You need to adjust the loanRate value to meet the requirements.
What should you do?
A. Replace line 15 with the following code segment: loanRate = 0.065m;
B. Replace line 07 with the following code segment: loanRate = 0.065m;
C. Replace line 17 with the following code segment: interestAmount = loanAmount * 0.065m * loanTerm;
D. Replace line 04 with the following code segment: decimal loanRate = 0.065m;
Answer: A
Q128. - (Topic 2)
You need to write a console application that meets the following requirements:
. If the application is compiled in Debug mode, the console output must display Entering debug mode. . If the application is compiled in Release mode, the console output must display Entering release mode.
Which code should you use?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: D
Explanation: Programmatically detecting Release/Debug mode (.NET)
Boolean isDebugMode = false;
#if DEBUG
isDebugMode = true;
#endif
Reference: http://stackoverflow.com/questions/654450/programmatically-detecting-release-debug-mode-net
Q129. - (Topic 1)
You are adding a public method named UpdateGrade to a public class named ReportCard.
The code region that updates the grade 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 UpdateGrade() method.
What should you do?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: A
Q130. HOTSPOT - (Topic 1)
You are implementing a library method that accepts a character parameter and returns a string.
If the lookup succeeds, the method must return the corresponding string value. If the lookup fails, the method must return the value "invalid choice."
You need to implement the lookup algorithm.
How should you complete the relevant code? (To answer, select the correct keyword in each drop-down list in the answer area.)
Answer: