Microsoft UPGRADE: MCAD Skills to MCTS Web Apps Using MS.NET Framework Sample Questions:
1. You work as the developer in an IT company. Recently your company has a big client. The client runs a large supermarket chain. According to the business requirement, the client needs a method to clear a Queue named q. Your company asks you to serve this client. You have to create the method for the client. In the options below, which code segment should you use?
A) q.Dequeue();
B) foreach (object e in q) { q.Dequeue();}
C) q.Clear();
D) foreach (object e in q) { Enqueue(null);}
2. You have just graduated from college, now you are serving the internship as the software developer in an international company. According to the requirements of the company CIO, you are creating a method. In order to verify the data, you have to use the MD5 algorithm to harsh data. The data is passed to your method as a byte array named message. You have to use MD5 to compute the hash of the incoming parameter. Besides this, the result has to be placed into a byte array. In the options below, which code segment should you use?
A) Dim objAlgo As HashAlgorithm = HashAlgorithm.Create("MD5")Dim hash() As Byte = BitConverter.GetBytes(objAlgo.GetHashCode)
B) Dim objAlgo As HashAlgorithm = HashAlgorithm.Create("MD5")Dim hash() As ByteobjAlgo.TransformBlock(message, 0, message.Length, hash, 0)
C) Dim objAlgo As HashAlgorithmobjAlgo = HashAlgorithm.Create(message.ToString)Dim hash() As Byte = objAlgo.Hash
D) Dim objAlgo As HashAlgorithm = HashAlgorithm.Create("MD5")Dim hash() As Byte = objAlgo.ComputeHash(message)
3. You work as the developer in an IT company. Recently your company has a big customer. The customer runs a large supermarket chain. You're appointed to provide technical support for the customer. Now according to the requirement of the customer, you create an application for its business partners to submit purchase orders. Its partners send XML documents to your customer. The application you create deserializes these XML documents into instances of an object named PurchaseOrder. You must make sure that if the deserialization process encounters any XML content that fails to map to public members of the PurchaseOrder object, the application collects details. So you have to modify the application. What should you do?
A) You should apply an XmlIgnore attribute to the PurchaseOrder class definition.
B) You should define and implement an event handler for the XmlSerializer.UnknownNode event.
C) You should define a class that inherits from XmlSerializer and overrides the XmlSerialize.FromMappings method.
D) You should apply an XmlInclude attribute to the PurchaseOrder class definition.
4. You have just graduated from college, now you are serving the internship as the software developer in an international company. According to the requirements of the company CIO, you create the following Web user control named ErrorMessages.
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="ErrorMessages.ascx.vb" Inherits="ErrorMessages" %> <script>
Protected m_Text As String = "This is a default message!"
Public Property Text() As String
Get
Return m_Text
End Get
Set(ByVal value As String)
m_Text = value End Set End Property </script>
The ErrorMessages control uses a public property. The public property displays the error message.
On the Web Form in which the control is implemented, you have to change the default error message property.
In the options below, which code segment should you use?
A) <fabrikam:Message id="MyMessage" Message_Text="This is a custom message!" runat="server"/>
B) <fabrikam:Message id="MyMessage" MessageText="This is a custom message!"
runat="server"/>
C) <fabrikam:Message id="MyMessage" MyMessage-Text="This is a custom message!" runat="server"/>
D) <fabrikam:Message id="MyMessage" Text="This is a custom message!" runat="server"/>
5. You work as the developer in an IT company. Recently your company has a client. The client needs a class. Your company asks you to develop a custom-collection class. In this class, a method has to be created. After the method has been created, the method has to return a type. And the type should be compatible with the Foreach statement.
Which criterion should the method meet?
A) The method must explicitly contain a collection.
B) The method must return a type of IComparable.
C) The method must return a type of either IEnumerator or IEnumerable.
D) The method must be the only iterator in the class.
Solutions:
| Question # 1 Answer: C | Question # 2 Answer: D | Question # 3 Answer: B | Question # 4 Answer: D | Question # 5 Answer: C |
We're so confident of our products that we provide no hassle product exchange.


By Quentin

