What should you do?
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...
Which code segment should you insert at line 04?
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...
How should you complete the relevant code?
DRAG DROP 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:...
How should you complete the relevant code?
DRAG DROP 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...
Which code segment should you use?
You are creating an application that manages information about zoo animals. The application includes a class named Animal and a method named Save. The Save() method must be strongly typed. It must allow only types inherited from the Animal class that uses a constructor that accepts no parameters. You need...
What should you do?
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...
How should you complete the relevant code?
DRAG DROP You are developing a class named ExtensionMethods. You need to ensure that the ExtensionMethods class implements the IsEmail() extension method on string objects. 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...
Which code segment should you insert at line 06?
You are developing an application that will convert data into multiple output formats. The application includes the following code. (Line numbers are included for reference only.) You are developing a code segment that will produce tab-delimited output. All output routines implement the following interface: You need to minimize the completion...
Which two actions should you perform?
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...
How should you complete the relevant code?
DRAG DROP You are developing an application that will include a method named GetData. The GetData() method will retrieve several lines of data from a web service by using a System.IO.StreamReader object. You have the following requirements: • The GetData() method must return a string value that contains the first...