PrepAway - Latest Free Exam Questions & Answers

Category: 70-505

Exam 70-505: TS: Microsoft .NET Framework 3.5, Windows Forms Application Development

Which code segment should you insert at line 07?

You are creating a Windows Forms application for a book retailer by using the .NET Framework 3.5.
You are creating a Windows form to allow users to maintain a list of books in an XML document.
You write the following code segment. (Line numbers are included for reference only.)

01 XmlDocument xmlDoc = new XmlDocument();
02 XmlNode bookstore = xmlDoc.CreateElement("bookstore");
03 xmlDoc.AppendChild(bookstore);
04 XmlElement book = xmlDoc.CreateElement("book");
05 book.SetAttribute("ISBN", strISBN);
06 XmlElement title = xmlDoc.CreateElement("title");
07

The variables strTitle and strISBN are already initialized with the necessary values.
You need to ensure that after the form is complete the XML document has the following structure.

<bookstore>
<book ISBN="n-nnn-nnnnn-nn">
<title>Title</title>
</book>
</bookstore>

Which code segment should you insert at line 07?

Which code segment should you insert at line 04?

You are creating a Windows Forms application by using the .NET Framework 3.5.
The application stores a list of part numbers in an integer-based array as shown in the following code segment. (Line numbers are included for reference only.)

01 var parts = new int[]
02 { 105, 110, 110, 235, 105,
03 135, 137, 205, 105, 100, 100 };
04
05 foreach (var item in results) {
06 tbResults.Text += item + "rn";
07 }

You need to use a LINQ to Objects query to perform the following tasks:
* Obtain a list of duplicate part numbers.Order the list by part numbers.
* Provide the part numbers and the total count of part numbers in the results.
Which code segment should you insert at line 04?

Which code segment should you use?

You are creating a Windows Forms application by using the .NET Framework 3.5.
You use LINQ expressions to read a list of customers from the following XML file.

<customers>
<customer id="135" birthDate="4/1/1968"> Paul Koch </customer>
<customer id="122" birthDate="7/5/1988"> Bob Kelly </customer>
<customer id="044" birthDate="3/24/1990"> Joe Healy </customer>
<customer id="982" birthDate="9/15/1974"> Matt Hink </customer>
<customer id="325" birthDate="1/7/2004"> Tom Perham </customer>
<customer id="134" birthDate="9/23/1946"> Jeff Hay </customer>
<customer id="653" birthDate="5/15/1947"> Kim Shane </customer>
<customer id="235" birthDate="4/24/1979"> Mike Ray </customer>
</customers>

You need to obtain a list of names of customers who are 21 years of age or older.
Which code segment should you use?

Which attribute should you use?

You are creating a Windows Forms application by using the .NET Framework 3.5.
You plan to design a composite custom control for the application.
You include a ListBox control inside the composite control. The control exposes a property that provides the item count of the ListBox control.
You need to ensure that the property cannot be accessed at design time.
Which attribute should you use?

Which method signature should you use?

You are creating a Windows Forms application by using the .NET Framework 3.5.
The application requires a thread that accepts a single integer parameter.
You write the following code segment. (Line numbers are included for reference only.)

01 Thread myThread = new Thread(new ParameterizedThreadStart(DoWork));
02 myThread.Start(100);
03 …

You need to declare the method signature of the DoWork method.
Which method signature should you use?


Page 3 of 41234