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 customer. The customer runs a large supermarket chain. You're appointed to provide technical support for the customer. Now according to the customer requirement, you create a Web Form which is for members only. The behavior of the Web site varies according to the role of the user. The Web site creates user accounts by using the ASP.NET Membership control. You have to identify whether a user is a member of a particular role. What should you do?
A) You should pass the user names to Membership.GetUser.
B) You should pass the role names to User.IsInRole.
C) You should pass the user names and passwords to Membership.ValidateUser.
D) You should pass the role names to Roles.RoleExists.
2. 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 you are creating a class library according to the customer requirement. The class library contains the class hierarchy defined in the following code segment. (Line numbers are included for reference only.)
1 public class Group {
2 public Employee[] Employees;
3 }
4 public class Employee {
5 public string Name;
6 }
7 public class Manager : Employee {
8 public int Level;
9 }
You create an instance of the Group class then populate the fields of the instance. You receive InvalidOperationException when you use the Serialize method of the XmlSerializer class to serialize the instance. Besides this, you receive the following error message: "There was an error generating the XML document."
In order to successfully use the XmlSerializer class to serialize instances of the Group class, you have to modify the code segment. And you must make sure that the XML output contains an element for all public fields in the class hierarchy.
What should you do?
A) Insert the following code between lines 1 and 2 of the code segment: [XmlArray(ElementName="Employees")]
B) Insert the following code between lines 3 and 4 of the code segment: [XmlElement(Type = typeof(Employee))] andInsert the following code between lines 6 and 7 of the code segment: [XmlElement(Type = typeof(Manager))]
C) Insert the following code between lines 1 and 2 of the code segment: [XmlArrayItem(Type = typeof(Employee))] [XmlArrayItem(Type = typeof(Manager))]
D) Insert the following code between lines 1 and 2 of the code segment: [XmlElement(Type = typeof(Employees))]
3. 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 class which contains a method named GetCurrentRate. The GetCurrentRate method retrieves the current interest rate and a variable named currRate that stores the current interest rate. You write serialized representations of the class. You have to write a code segment, when an instance of the class is deserialized, the segment updates the currRate variable with the current interest rate. So what code segment should you write?
A) <OnSerializing> _ Friend Sub UpdateValue(ByVal info As SerializationInfo) info.AddValue("currentRate", GetCurrentRate())End Sub
B) <OnSerializing> _Friend Sub UpdateValue (ByVal context As StreamingContext) currRate = GetCurrentRate()End Sub
C) <OnDeserialized> _Friend Sub UpdateValue (ByVal context As StreamingContext) currRate = GetCurrentRate()End Sub
D) <OnDeserializing> _ Friend Sub UpdateValue(ByVal info As SerializationInfo) info.AddValue("currentRate", GetCurrentRate())End Sub
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're developing a server. You are developing a method to hash data with the Secure Hash Algorithm. The data is passed to your method as a byte array named message. You have to use SHA1 to compute the hash of the incoming parameter. Besides this, you have to place the result into a byte array named hash. In the options below, which code segment should you use?
A) Dim objSHA As New SHA1CryptoServiceProviderDim hash() As Byte = NothingobjSHTransformBlock(message, 0, message.Length, hash, 0)
B) Dim objSHA As New SHA1CryptoServiceProviderDim hash() As Byte = BitConverter.GetBytes(objSHA.GetHashCode)
C) Dim objSHA As New SHA1CryptoServiceProviderobjSHA.GetHashCode()Dim hash() As Byte = objSHA.Hash
D) Dim objSHA As New SHA1CryptoServiceProviderDim hash() As Byte = objSHA.ComputeHash(message)
5. 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 a Web application for the company's intranet. The company wants to enable users to customize their versions of the intranet home page. You create sections of content as Web Parts. You need to ensure that users can customize content at any time. In the options below, which code segment should you use?( choose more than one)
A) <asp:CatalogZone ID="CatalogZone1" Runat="server"> <ZoneTemplate> <asp:PageCatalogPart Runat="server" ID="PageCatalogPart1" /> </ZoneTemplate></asp:CatalogZone>
B) <asp:ConnectionsZone ID="ConnectionsZone1" Runat="server"> <ConnectVerb Enabled="true" /></asp:ConnectionsZone>
C) <asp:WebPartZone ID="WebPartZone1" Runat="server"> <ZoneTemplate> </ZoneTemplate></asp:WebPartZone>
D) <asp:ProxyWebPartManager ID="ProxyWebPartmanager1" Runat="server" />
Solutions:
| Question # 1 Answer: B | Question # 2 Answer: C | Question # 3 Answer: C | Question # 4 Answer: D | Question # 5 Answer: A,C |
We're so confident of our products that we provide no hassle product exchange.


By Nick

