PrepAway - Latest Free Exam Questions & Answers

Author: seenagape

Which code segment should you insert at line 13?

You are creating a Microsoft Office SharePoint Server 2007 Web Part.

You write the following code segment. (Line numbers are included for reference only.)

01 public Button cmdCrawl;
02 protected override void CreateChildControls()
03 {
04 cmdCrawl = new Button();
05 cmdCrawl.Click += new EventHandler(cmdCrawl_Click);
06 cmdCrawl.Text = “Update Index”;
07 }

08 public void cmdCrawl_Click(object sender, EventArgs e)
09 {
10 Microsoft.Office.Server.Search.Administration.Content sspContent =
11 new Microsoft.Office.Server.Search.Administration.Content
12 (SearchContext.Current);
13 …

14 }

You need to ensure that the Web Part initiates a search crawl of a scope named Patents.

Which code segment should you insert at line 13?

Which component members should you test?

You create Microsoft Windows-based applications. Two of your Windows-based applications require the use of graphical progress indicators. These indicators are based on bitmap files. Such a component is not available in the .NET Framework.

To facilitate the search for a component, you identify the following requirements:

Component exposes a property to set a bitmap file that is used for the progress bar. Component permits the use of at least two types of progress bars. These progress bars are named percent progress and numeric progress.
Component exposes a method to increment the progress bar.

You find a component that fulfills all the requirements. You create a new component that extends the original component and overrides the Increment method. The Windows-based applications might use either the original component or the extended component. You write a test project to test the component. You need to ensure that all the requirements are met. You want to achieve this goal by using the minimum amount of programming effort. Which component members should you test?

Which code segment should you use?

You create Web-based client applications. You are creating a class named Product. The Product class will be used by a Web-based application to retrieve and modify product information.

When you create an instance of the Product class, you retrieve the current information from the Products table. The Product class contains a static member named CreateNewProduct. The CreateNewProduct method is used to add a new product to the database and return the primary key.
The Products table contains the following fields:

ProductID (primary key)
ProductName
Description
CategoryID
CurrentPrice

You need to create the constructor for the Product class. Which code segment should you use?

What should you do?

You create Microsoft Windows-based applications. You are creating a stock trading application. The application keeps track of stock prices and raises events when the stock prices increase or decrease. The events are raised based on specific thresholds. When the events are raised, users specify whether to buy, sell, or hold the stocks. The stock trading application currently uses the Trace class to log the events raised by the application and the user responses. The raised events and the user responses are then logged to a Windows application log.

You change the application logging mechanism to meet the following requirements:

Log entries are saved in a central database.
Log entries are also saved to the local application log.
Other applications are able to use the same logging mechanism.
The application code is changed as little as possible.
You create a central database to store log entries for multiple databases. You need to choose a system-wide logging mechanism that is reused by the application and is a part of the application design structure. What should you do?