Which three actions should you perform?
You are creating a class that uses unmanaged resources.
This class maintains references to managed resources on other objects.
You need to ensure that users of this class can explicitly release resources when the class instance ceases to be needed.
Which three actions should you perform?
(Each correct answer presents part of the solution. Choose three.)
The following code is included in the CalcSalary class:
You have been given the responsibility of creating a class named CalcSalary that will determine the salaries of Domain.com’s staff.
The CalcSalary class includes methods to increment and decrement staff salaries. The following code is included in the CalcSalary class:
public class CalcSalary {
// for promotions
public static bool IncrementSalary (Employee Emp, double Amount){
if (Emp.Status == QuarterlyReview.AboveGoals)
Emp.Salary += Amount;
return true;
What interface should be used?
You work as an application developer at Domain.com. You are developing a collection class named ClientCollection,
which is to be used for storing the names of Domain.com’s clients that are situated in various geographical areas.
These client names are represented by the Client class. You are planning to create a method named SortClients in the ClientCollection class to arrange Client objects in ascending order.
You need to ensure that the appropriate interface is implemented by the Client class to allow sorting.
What interface should be used?
public class EmployeeCollection :
Domain.com wants you to develop an application that stores and retrieves employee information
by means of a unique staff number.
You create a custom collection class, which implements the type-safe IDictionary interface.
This collection class is named EmployeeCollection, and is defined using the following code.
public class EmployeeCollection : IDictionary {
// Implementation code
}
What should you use to create the collection?
Domain.com has been hired by a small local private school to develop a class library that will be used in an application named ManageAttendance for the purpose of managing student records.
You are responsible for developing this class library. Domain.com has instructed you to create a collection in the application to store learners’ results.
The school has informed you that they currently only have seven learners, but that this value will triple in the following year.
Due to the limited resources, you need to ensure that the collection you create consumes a minimum amount of resources.
What should you use to create the collection?
What code should you use?
You have recently created a custom collection class named ShoppingList for a local supermarket.
This custom class will include ShoppinItem objects that have the public properties listed below.
* Name
* AisleNumber
* OnDiscount
You are required to enable users of your class to iterate through the ShoppingList collection, and to list each product name and aisle number using the foreach statement.
You need to achieve this by declaring the appropriate code.
What code should you use?
You start by defining the Customer class as shown below:
You are currently in the process of creating a class that stores data about Domain.com’s customers.
Domain.com customers are assigned unique identifiers and various characteristics that may include
aliases, shipping instructions, and sales comments.
These characteristics can change in both size and data type. You start by defining the Customer class as shown below:
public class Customer{
private int custID;
private ArrayList attributes;
public int CustomerID {
You are required to optimize memory usageWhat should you do?
Domain.com uses Visual Studio.NET 2005 as its application development platform.
You are in the process of storing numerical values up to 2,100,000,000 into a variable and may require storing negative values using a .NET Framework 2.0 application.
You are required to optimize memory usage
What should you do?
Which code segment should you use?
You are developing a fiscal report for a customer.
Your customer has a main office in the United States and a satellite office in Mexico.
You need to ensure that when users in the satellite office generate the report, the current date is displayed in Mexican Spanish format.
Which code segment should you use?
Which code segment should you use?
You need to generate a report that lists language codes and region codes.
Which code segment should you use?