You are debugging an application that calculates loan interest. The application includes the following code. (Line numbers are included for reference only.)

You have the following requirements:
* The debugger must break execution within the Calculatelnterest() method when the loanAmount variable is less than or equal to zero.
* The release version of the code must not be impacted by any changes.
You need to meet the requirements.
What should you do?
Answer : C
By default, the Debug.Assert method works only in debug builds. Use the Trace.Assert method if you want to do assertions in release builds. For more information, see Assertions in Managed Code.
http://msdn.microsoft.com/en-us/library/kssw4w7z.aspx
You are developing an application. The application includes a method named ReadFile that reads data from a file.
The ReadFile() method must meet the following requirements:
* It must not make changes to the data file.
* It must allow other processes to access the data file.
* It must not throw an exception if the application attempts to open a data file that does not exist.
You need to implement the ReadFile() method.
Which code segment should you use?
Answer : A
FileMode.OpenOrCreate - Specifies that the operating system should open a file if it exists; otherwise, a new file should be created. If the file is opened with FileAccess.Read, FileIOPermissionAccess.Read permission is required. If the file access is FileAccess.Write, FileIOPermissionAccess.Write permission is required. If the file is opened with FileAccess.ReadWrite, both FileIOPermissionAccess.Read and FileIOPermissionAccess.Write permissions are required.
http://msdn.microsoft.com/en-us/library/system.io.filemode.aspx
FileShare.ReadWrite - Allows subsequent opening of the file for reading or writing.If this flag is not specified, any request to open the file for reading or writing (by this process or another process) will fail until the file is closed.However, even if this flag is specified, additional permissions might still be needed to access the file.
http://msdn.microsoft.com/pl-pl/library/system.io.fileshare.aspx
You are developing an application that uses the Microsoft ADO.NET Entity Framework to retrieve order information from a Microsoft SQL Server database. The application includes the following code. (Line numbers are included for reference only.)

The application must meet the following requirements:
* Return only orders that have an OrderDate value other than null.
* Return only orders that were placed in the year specified in the year parameter.
You need to ensure that the application meets the requirements. Which code segment should you insert at line 08?

Answer : B
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?
Answer : C
The GC.KeepAlive method references the specified object, which makes it ineligible for garbage collection from the start of the current routine to the point where this method is called.
The purpose of the KeepAlive method is to ensure the existence of a reference to an object that is at risk of being prematurely reclaimed by the garbage collector.
The KeepAlive method performs no operation and produces no side effects other than extending the lifetime of the object passed in as a parameter.
https://msdn.microsoft.com/en-us/library/system.gc.keepalive(v=vs.110).aspx
You are developing an application that uses the Microsoft ADO.NET Entity Framework to retrieve order information from a Microsoft SQL Server database. The application includes the following code. (Line numbers are included for reference only.)

The application must meet the following requirements:
* Return only orders that have an OrderDate value other than null.
* Return only orders that were placed in the year specified in the OrderDate property or in a later year.
You need to ensure that the application meets the requirements.
Which code segment should you insert at line 08?
Answer : A
*For the requirement to use an OrderDate value other than null use:
OrderDate.Value != null
*For the requirement to use an OrderDate value for this year or a later year use:
OrderDate.Value>= year
You are developing an application that includes a class named Order. The application will store a collection of Order objects.
The collection must meet the following requirements:
* Use strongly typed members.
* Process Order objects in first-in-first-out order.
* Store values for each Order object.
* Use zero-based indices.
You need to use a collection type that meets the requirements.
Which collection type should you use?
Answer : A
Queues are useful for storing messages in the order they were received for sequential processing. Objects stored in a Queue<T> are inserted at one end and removed from the other.
You have the following code.

You need to remove all of the data from the myData list.
Which code should you use?