Which code segment should you use?
You create a Microsoft Office InfoPath workflow task form for users. The form contains all the details of each task. You need to store the value of the Comments field in a variable named UserInput when each user submits the form. Which code segment should you use?
Which code segment should you insert at line 04?
You are creating a Microsoft Windows SharePoint Services application.
You write the following code segment. (Line numbers are included for reference only.)
01 Public Sub DownloadDocument ( ByVal web As SPWeb )
02 Dim docLib As SPDocumentLibrary = _
CType ( web.Lists (“shared Documents”), SPDocumentLibrary )
03 Const fil eShare As String = “C:\Download”
04 …
05 End Sub
You need to move each document to the C:\Download folder. You also need to remove each document from the document library.
Which code segment should you insert at line 04?
Which two actions should you perform?
You create Microsoft Windows-based applications. You are reviewing code for an application that is created for a bank. You find that a Microsoft Windows Form includes the following code segment.
public partial class ATMDeposit : Form {
private BankAccount account;
public ATMDeposit() {
InitializeComponent();
}
private void ATMDeposit_Load(object sender, EventArgs e) { account = new BankAccount();
}
private void cmdDeposit_Click(object sender, EventArgs e) { account.Deposit(decimal.Parse(txtAmount.Text));
}
}
You analyze the code segment and find that the form handles no other events. You need to suggest changes to improve reliability. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
What should you do?
You create an Office Visio 2007 solution that consists of an add-in DLL for Visio 2007, a Visio 2007 stencil, and a Visio 2007 template. You need to ensure that the Visio 2007 solution can be deployed for the English, German, and Italian language versions of Visio 2007. What should you do?
Which strategy should you use?
You create Web-based client applications. You are creating a content management system (CMS). You intend to sell CMS to your customers. It is important that customers customize the appearance and behavior of the CMS installation because the system will be used for external Web sites. However, your customers are not programmers. The customers will not be able to modify complicated source code to customize the appearance and behavior of their Web sites. You need to create the system in such a way that customers can modify the appearance and behavior of their Web
sites by editing the minimum number of files, ideally one or two. Which strategy should you use?
Which code segment should you use?
You are creating a Web application by using the Virtual Earth 6.0 map control.
A Web page of the application loads a map of a predefined location by using the following code segment.
var map = null;
var defView1= new VEMapViewSpecification(new
VELatLong(40.689167,-74.04472), 16, 360, -45, 0);
function GetMap(){
map = new VEMap(‘myMap’);
map.LoadMap(); map.SetMapView(defView1);
map.SetMapStyle(‘h’)
map.SetMapMode(VEMapMode.Mode3D);
}
You need to display a zoomed out view of the main map in a separate control on the same Web page.
Which code segment should you use?
What should you do?
Your company stores employee details in a Microsoft SQL Server database.
You are creating a Report Center site on a Microsoft Office SharePoint Server 2007 server. You need to ensure that a report on employee details can be generated in the Report Center site. What should you do?
Which code segment should you insert at line 04?
You create a Microsoft Windows SharePoint Services list named Books. The list has a column named Stock that stores the total number of available books.
You write the following code segment. (Line numbers are included for reference only.)
01 Protected Overloads Overrides Sub CreateChildControls()
02 Dim myWeb As SPWeb = SPControl.GetContextWeb(Context)
03 Dim myList As SPList = my Web .Lists(“Books”)
04 …
05 Dim myGrid As DataGrid = New DataGrid
06 myGrid.DataSource = results
07 myGrid.DataBind
08 Me.Controls.Add(myGrid)
09 End Sub
You need to render a list of books for which the value in the Stock column is less than 100.
Which code segment should you insert at line 04?
Which methods should you choose?
You create Microsoft Windows-based applications. You are designing a unit test for a form in an application. You write the following code segment. (Line numbers are included for reference only.)
01 public partial class frmCalculation : Form {
02 public frmCalculation() {
03 InitializeComponent();
04 }
05 private void cmdFib_Click(object sender, EventArgs e) { 06 lblResult.Text = Fibonacci(int.Parse(txtNumber.Text)).ToString(); 07 }
08 private void cmdFac_Click(object sender, EventArgs e) { 09 lblResult.Text = Factorial(int.Parse(txtNumber.Text)).ToString(); 10 }
11 private int Fibonacci(int number) {
12 if (number < 3)
13 return 1;
14 else
15 return Fibonacci(number – 1) + Fibonacci(number – 2);
16 }
17 private int Factorial(int number) {
18 int total = 1;
19 for (int x = number; x > 1; x–)
20 total *= x;
21 return total;
22 }
23 }
You need to identify the methods that must be included for unit testing. Which methods should you choose?
Which line of code should you modify?
You develop an Office Visio 2007 Shared Add-in that contains custom code.
The add-in code contains three variables: objShape, objMaster, and objCell. The variable objShape references a Visio shape. The variable objMaster references a Visio master. The variable objCell references a Visio cell. The relevant code is displayed in the following table:
You need to modify the add-in to support the creation of master shapes in different languages by using the same code base.
Which line of code should you modify?