PrepAway - Latest Free Exam Questions & Answers

Author: seenagape

Which line of code should you insert at line 08?

You create an application by using the Microsoft .NET Framework 3.5 and Microsoft
ADO.NET.You write the following code segment. (Line numbers are included for reference
only.)
01 DataTable dt = new DataTable();
02 dt.Columns.Add(“number”);
03 dt.Columns.Add(“string”);
04 dt.Rows.Add(1, “3”);
05 dt.Rows.Add(2, “2”);
06 dt.Rows.Add(3, “1”);
07 var result = from p in dt.AsEnumerable()
08
09 foreach (var number in result) {
10 Console.Write(number.ToString());
11 }
You need to display the string “321”.Which line of code should you insert at line 08?

Which line of code should you add to ensure that the value of the count variable is 4?

You create an application by using the Microsoft .NET Framework 3.5 and Microsoft
ADO.NET.You write the following code segment.
DataTable dt = new DataTable(“Strings”);
dt = new DataTable();
dt.Columns.Add(“Strings”);
dt.Rows.Add(“A-B”);
dt.Rows.Add(“C-D”);
var c = from Strings in dt.AsEnumerable()
select Strings[0];
int count = 0;
You need to ensure that the value of the count variable is 4. Which line of code should you add?

What should you do?

You create an application by using Microsoft Visual Studio .NET 2008 and the .NET Framework 3.5. You are designing the database schema of the application. The database schema is as shown in the exhibit. (Refer to the Exhibit.)

You need to ensure that the design meets the following requirements:
The database contains no duplicate data.
A category can contain zero or more products.
Each product can be associated with zero or more categories.
What should you do?

What should you do?

You work as the Enterprise application developer at Domain.com. The Domain.com network consists of a single Active Directory domain named Domain.com. All servers in the domain run Windows Server 2003. Your responsibilities at Domain.com include the design and development of application frameworks.
You are currently developing a Microsoft Windows Forms monitoring application for Domain.com. This application is destined to read data in a Microsoft SQL Server 2005 database and display it graphically on a form. All Domain.com users need to be able to:
1. choose the refresh rate for displaying data
2. choose an interval in multiples of one second
To this end you need to reuse a component to meet these requirements without requiring excessive coding.

What should you do?

Which code segment should you write?

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
The application has a mobile Web form that contains the following ObjectList control.

<mobile:ObjectList ID=”ObjectListCtrl” OnItemCommand=”ObjectListCtrl_ItemCommand” Runat=”server”>
<Command Name=”CmdDisplayDetails” Text=”Details” />
<Command Name=”CmdRemove” Text=”Remove” />
</mobile:ObjectList>

You create an event handler named ObjectListCtrl_ItemCommand.

You need to ensure that the ObjectListCtrl_ItemCommand handler detects the selection of the CmdDisplayDetails item.

Which code segment should you write?

What should you do?

You create an application by using the Microsoft .NET Framework 3.5 and Microsoft
ADO.NET.You write the following code segment. (Line numbers are included for reference
only.)
01 private void GetRecords(SqlDataAdapter da, DataTable table) {
02
03 try {
04 da.Fill(table);
05 }
06 catch (SqlException exp) {
07
08 }
09 finally {
10
11 }
12 }
13
The da.SelectCommand.CommandText property is set to a stored procedure. The stored
procedure declares a variable named @msg.For each record that contains a bad shipping
address, the stored procedure performs the following tasks:
It sets @msg with the id of the record.
It raises an error for the record.
The error raised is as shown in the following text:
RaiseError(@msg, 10, 1)
You need to ensure that all valid records are retrieved even if invalid records are present.
You also need to ensure that a list item is added to the lstResults list box for each invalid
record. What should you do?

What should you do?

You create an application by using Microsoft Visual Studio .NET 2008 and the .NET Framework 3.5. The application includes two namespaces named Contoso.Security and Contoso.Log. Classes in the Contoso.Security namespace will be distributed for use in a data access layer component. Classes in the two namespaces will be distributed for use by other client components in the application. Not all client components will use both the Contoso.Security and Contoso.Log classes. You plan to design a strategy for component reuse. You need to ensure that unnecessary code is not distributed to any client application. You also need to ensure that all necessary code is available to dependent components. What should you do?

What should you do?

You work as the Enterprise application developer at Domain.com. The Domain.com network consists of a single Active Directory domain named Domain.com. All servers in the domain run Windows Server 2003. Your responsibilities at Domain.com include the design and development of applications. Domain.com operates as an Independent Electoral Commission. You are currently developing a voter registration application for Domain.com. Following is a list of the facts that must be taken into account:
1. A voter is associated with one political party.
2. A voter has one mailing address.
3. A mailing address can belong to multiple voters.
4. It is estimated that on average each mailing address can be used by two voters.
5. A voter has two telephone contact numbers.
6. A contact phone number can belong to multiple voters.
7. It is estimated that on average each contact phone number can be used by two voters.

The plan is to design the database schema based on these facts. Now you need to decide on the minimum number of tables that will be required. In your solution you must ensure that it offers the best performance.

What should you do? (Choose the correct amount of tables required.)