Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C# (http://www.go4expert.com/forums/c-sharp/)
-   -   Check Your C# Experince Here (http://www.go4expert.com/forums/check-c-sharp-experince-t14594/)

damoonica 17Oct2008 12:12

Check Your C# Experince Here
 
a place to add usefull problem like question specially for those who are going to be ready for MCTS 70-536

damoonica 17Oct2008 12:14

Re: Check Your C# Experince Here
 
QUESTION 1
You work as the application developer at Certkiller .com. Certkiller .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?
A. Int32
B. UInt16
C. UInt32
D. Int16

damoonica 17Oct2008 12:14

Re: Check Your C# Experince Here
 
the answer will be available after 3 comments

Bitmatic 2Nov2008 21:39

Re: Check Your C# Experince Here
 
Good one. http://www.codecharts.com/typeranges.php has the answer :)
The answer is Int32, since it can hold from -2,147,483,648 to 2,147,483,647.

damoonica 3Nov2008 09:55

Re: Check Your C# Experince Here
 
You got it , the correct answer is A
so then check out the another question:

You work as an application developer at www.megaposts.net . You are currently in the

process of creating a class that stores data about Certkiller .comís customers.

Certkiller .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

{

get {return custID;}

}
public Customer (int CustomerID)

{

this.custID = CustomerID;

this.attributes = new ArrayList ();

}

public void AddAttribute (object att)

{

attributes.Add (att);

}

}
You have to create the FindAttribute method for locating attributes in Customer

objects no matter what the data type is.

You need to ensure that the FindAttribute method returns the attribute if found,

and you also need to ensure type-safety when returning the attribute.

What should you do?

A. Use the following code to declare the FindAttribute method:
public T FindAttribute (T att)

{

//Find attribute and return the value

}
B. Use the following code to declare the FindAttribute method:
public object FindAttribute (object att)

{

//Find attribute and return the value

}
C. Use the following code to declare the FindAttribute method:
public T FindAttribute <T> (T att)

{

//Find attribute and return the value

}
D. Use the following code to declare the FindAttribute method:
public string FindAttribute (string att)

{

//Find attribute and return the value

}


All times are GMT +5.5. The time now is 01:37.