Summer Special Sale Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: vce65

You work as a Software Developer for ABC Inc.

You work as a Software Developer for ABC Inc. The company uses Visual Studio .NET 2005 as its application development platform. You have created a class named Customer to be used in a billing application. The Customer class is shown below.

class Customer

{

public string FirstName { get; set; }

public string LastName { get; set; }

}

Each instance of the Customer class contains information about a customer of your company. You have written a segment of code that populates an ArrayList with a collection of Customer objects as shown below.

ArrayList customers = new ArrayList();

Customer myCustomer = new Customer();

myCustomer.FirstName = "Helen";

myCustomer.LastName = "of Troy";

customers.Add(myCustomer);

myCustomer = new Customer();

myCustomer.FirstName = "Elvis";

myCustomer.LastName = "Presley";

customers.Add(myCustomer);

You need to write code that iterates through the customers ArrayList and displays the name of each customer at the command prompt.

Which code segment should you choose?

A.

foreach (Customer customer in customers) {

Console.WriteLine("{0} {1}",

(Customer)customer.FirstName,

(Customer)customer.LastName);

}

B.

foreach (Customer customer in customers) {

Console.WriteLine("{0} {1}",

customer.FirstName,

customer.LastName);

}

C.

for (int counter = 0; counter <= customers.Count; counter++) {

Console.WriteLine(customers[counter].ToString());

}

D.

for (int counter = 0; counter <= customers.Count; counter++) {

Console.WriteLine(customers[counter]);

}

GIAC GSSP-NET-CSHARP Summary

  • Vendor: GIAC
  • Product: GSSP-NET-CSHARP
  • Update on: Jul 25, 2025
  • Questions: 491
Price: $52.5  $149.99
Buy Now GSSP-NET-CSHARP PDF + Testing Engine Pack

Payments We Accept

Your purchase with ExamsVCE is safe and fast. Your products will be available for immediate download after your payment has been received.
The ExamsVCE website is protected by 256-bit SSL from McAfee, the leader in online security.

examsvce payment method