PrepAway - Latest Free Exam Questions & Answers

Category: 70-552

Exam 70-552: UPGRADE: MCAD Skills to MCPD Windows Developer by Using the Microsoft .NET Framework

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?

Which two tests should you choose?

You create Microsoft Windows-based applications. The sales department uses an application that accesses data from a local Microsoft Office Access database. To enable sales representatives to access the application when they are not in the office, you plan to install the application on a terminal server. The application will be accessed by 200 users simultaneously through a terminal services connection. You need to design an appropriate test strategy for the change.
Which two tests should you choose? (Each correct answer presents part of the solution. Choose two.)

Which line of code should you use to replace the code on line 06?

You create Microsoft Windows-based applications. You review code for an application that is developed for a bank. You need to test a method named Deposit in one of the application components. The following code segment represents the Deposit method. (Line numbers are included for reference only.)

01 public void Deposit(decimal amount) {
03 if (!(amount > 0)) {
04 throw new Exception(“Invalid deposit amount!”);
05 } else {
06 this.balance += amount;
07 }
08 }

You use the Microsoft Visual Studio 2005 test feature to automatically generate the following unit test.
(Line numbers are included for reference only.)

01 [TestMethod()]
02 public void DepositTest() {
03 BankAccount target = new BankAccount(); //balance will be ZERO
04 decimal amount = 100;
05 target.Deposit(amount);
06 Assert.Inconclusive(“A method that does not return a value cannot be verified.”);
07 }

You need to change the test method to return a conclusive result.
Which line of code should you use to replace the code on line 06?

Which two components should you include?

You create Microsoft Windows-based applications. You are designing integration tests for an application that your team is developing. Your team uses an application framework that is developed in-house.

The application consumes the following elements:

Third-party Web services
A third-party API for sending text messages to mobile phones Components from the application framework to access SQL Server databases and e-mail messages Managed code to access flat files in the file system

You need to create a report that lists the components that must be considered for integration testing.
Which two components should you include? (Each correct answer presents part of the solution. Choose two.)

Which two actions should you recommend?

You create Microsoft Windows-based applications.

You receive the following code segment to review. (Line numbers are included for reference only.)

01 public partial class frmReceivables : Form
02 {
03 private DataSet ds;
04 public frmReceivables()
05 {
06 InitializeComponent();
07 }
08 private void frmReceivables(object sender, EventArgs e)
09 {
10 SqlConnection cn = new SqlConnection(strConnectionString);
11 SqlDataAdapter daInvoices = new SqlDataAdapter(“SELECT * FROM Invoices”, cn);
12 SqlDataAdapter daCustomers = new SqlDataAdapter(“SELECT * FROM Customers”, cn);
13 ds = new DataSet(“Receivables”);
14 daInvoices.Fill(ds);
15 daCustomers.Fill(ds);
16 }
17 }

The strConnectionString variable is pre-populated from the application configuration file. Query statements will remain unchanged throughout the life cycle of the application. Connection pooling is not being used. This code segment accesses a Microsoft SQL Server 2000 database. The ds dataset is bound to a data grid view so that users can view and update data in the database. The code currently compiles correctly and works as intended. You need to enhance performance and reliability for this code.
Which two actions should you recommend? (Each correct answer presents part of the solution. Choose two.)

Which code segment should you use?

You are creating a Windows Forms application that includes the database
helper methods UpdateOrder and UpdateAccount. Each method wraps code that connects to a Microsoft SQL Server 2005 database, executes a Transact-SQL statement, and then disconnects from the database. You must ensure that changes to the database that result from the UpdateAccount method are committed only if the UpdateOrder method succeeds. You need to execute the UpdateAccount method and the UpdateOrder method.
Which code segment should you use?

What should you do?

A method in your Windows Forms application executes a stored procedure in a Microsoft SQL Server 2005 database, and then executes a second stored procedure in a second SQL Server 2005 database. You need to ensure that the call to the first stored procedure writes changes only if the call to the second stored procedure succeeds. Installation requirements prohibit you from introducing new components that use the COM+ hosting model.
What should you do?

Which code segment should you use?

A Windows Forms application contains the following code segment.

string SQL = @”SELECT OrderID, ProductID, UnitPrice, Quantity FROM [Order Details]”;
SqlDataAdapter da = new SqlDataAdapter(SQL, connStr);
DataTable dt = new DataTable();
da.Fill(dt);

You need to add a new column to the data table named ItemSubtotal. The ItemSubtotal column must contain the value of the UnitPrice column multiplied by the value of the Quantity column.
Which code segment should you use?

<?xml version="1.0"?

A Windows Forms application reads the following XML file.

<?xml version=”1.0″?>
<x:catalog xmlns:x=”urn:books”>
<book id=”bk101″>
<author>Gambardella, Matthew</author>
<title>XML Developer’s Guide</title>
</book>
<book id=”bk102″>
<author>Ralls, Kim</author>
<title>Midnight Rain</title>
</book>
</x:catalog>

The form initialization loads this file into an XmlDocument object named docBooks. You need to populate a ListBox control named lstBooks with the concatenated book ID and title of each book.
Which code segment should you use?


Page 8 of 12« First...678910...Last »