PrepAway - Latest Free Exam Questions & Answers

Author: seenagape

What should you do?

You are creating a Windows Communication Foundation (WCF) service that accepts messages from clients
when they are started. The message is defined as follows:

[MessageContract]
public class Agent
{
public string CodeName { get; set; }
public string SecretHandshake { get; set; }
}

You have the following requirements:
* The CodeName property must be sent in clear text.
* The service must be able to verify that the property value was not changed after being sent by the client.
* The SecretHandshake property must not be sent in clear text and must be readable by the service.

What should you do?

Which code fragment should you insert at line 12?

You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.
The application displays a list of books.
You write the following code fragment. (Line numbers are included for reference only.)
01<Window.Resources>
02<XmlDataProvider x:Key=”InventoryData” XPath=”Books”>
03<x:XData>
04<Books xmlns=””>
05<Book Title=”XML in Action” Stock=”in” />
06<Book Title=”Inside C#” Stock=”out” />
07<Book Title=”Introducing Microsoft .NET” Stock=”in”/>
08</Books>
09</x:XData>
10 </XmlDataProvider>
11<Style x:Key=”MyItemStyle” TargetType=”{x:Type ListBoxItem}”>
12
13</Style>
14</Window.Resources>
15<ListBox ItemContainerStyle=”{StaticResource MyItemStyle}”>
16<ListBox.ItemsSource>
17<Binding Source=”{StaticResource InventoryData}” XPath=”Book”/>
18</ListBox.ItemsSource>
19<ListBox.ItemTemplate>
20<DataTemplate>
21<TextBlock>
22<TextBlock.Text>
23<Binding XPath=”@Title”/>
24</TextBlock.Text>
25</TextBlock>
26</DataTemplate>
27</ListBox.ItemTemplate>
28</ListBox>
You need to ensure that book titles that are out of stock appear in red.
Which code fragment should you insert at line 12?

What should you recommend?

You are designing a Windows Presentation Foundation (WPF) application. The WPF application displays indicators to compare your company’s past performance to the current day’s operations data. The WPF application accesses historic data from your company’s data warehouse through a Web service, and accesses current data directly from a Microsoft SQL Server 2008 database.

The WPF application must meet the following requirements:
Retrieve historic data from the data warehouse at application startup and then once per day. Retrieve current data from the database every five minutes, and then update the indicators.
Cache all retrieved data.
Target the .NET Framework 4 Client Profile.
You need to recommend an approach to data caching.

What should you recommend?

Which code segment should you write for the click event handler for btnDetails?

You create a Windows client application by using Windows Presentation Foundation (WPF).
The application contains the following code fragment.
<Window.Resources>
<DataTemplate x:Key=”detail”>
<!–…–>
</DataTemplate>
</Window.Resources>
<StackPanel>
<ListBox Name=”lbDetails”>
</ListBox>
<Button Name=”btnDetails”>Details</Button>
</StackPanel>
You need to assign lbDetails to use the detail data template when btnDetails is clicked.
Which code segment should you write for the click event handler for btnDetails?

What should you do?

You are creating a Windows Communication Foundation (WCF) service to process orders.
The data contract for the order is defined as follows:

[DataContract]
public class Order
{
[DataMember]
public string CardHolderName { get; set; }
[DataMember]
public string CreditCardNumber { get; set; }
}

You have the following requirements:
* Enable the transmission of the contents of Order from the clients to the service.
* Ensure that the contents of CreditCardNumber are not sent across the network in clear text.
* Ensure that the contents of CreditCardNumber are accessible by the service to process the order.

You need to implement the service to meet these requirements. What should you do?

What should you do ?

You are developing a Windows Forms application that contains a DataGridView control. The DataGridView capture the customer’s name, address, and phone number.

You have been asked to provide data validation in a DataGridView to prevent users from leaving the..

You need to ensure that users cannot tab out of the name field without entering data

What should you do ?

What should you do?

You are developing an application by using Microsoft .NET Framework 4 and Microsoft Visual Studio 2010.

The application contains a grid that displays customer data stored in a database table. Users report that the grid takes a long time to display.

You plan to implement data caching to improve loading time for the grid.

You need to ensure that the cached data expires when the customer data is updated.

What should you do?

What should you do?

You use Microsoft .NET Framework 4 to create an application.
The application performs resource-intensive calculations that consist of multiple layers of nested looping.
The application will be deployed to servers that contain varying hardware configurations.
You need to ensure that the application utilizes CPU resources on the server in the most efficient manner.
You want to achieve this goal by using the minimum amount of code.
What should you do?

Which two lines of code should ou insert between lines 02 and 03?

A Windows Communication Foundation (WCF) client application is consuming an RSS syndication feed from a blog.
You have a SyndicationFeed variable named feed. The application iterates through the items as follows.
(Line numbers are included for reference only.)

01 foreach (SyndicationItem item in feed.Items)
02 {
03 }

You need to display the content type and body of every syndication item to the console.
Which two lines of code should ou insert between lines 02 and 03?

What should you do?

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create a Windows Presentation
Framework (WPF) application.
You have a page named myPage that contains the following code fragment.
<Page.Resources>
<SolidColorBrush x:Key=”CustomerNameBrush” Color=”SkyBlue”/>
</Page.Resources>
You need to ensure that other pages in your application can use CustomerNameBrush.
What should you do?