PrepAway - Latest Free Exam Questions & Answers

<?xml version="1.0" encoding="utf-8"?

Refer to the following lines in the case study: PA40 in \Model\Part.cs, PR16 in\Model\Product.cs, and CT14 in \Model\Component.cs

The application must create XML files that detail the part structure for any product. The XML files must use the following format:

<?xml version=”1.0″ encoding=”utf-8″?>
<product name=”Brush” description=”Brush product” productType=”1″>
<component name=”Handle” description=”Handle” partType=”2″>
<component name=”Screw” description=”Screw” partType=”3″>
<component name=”Wood” description=”Wooden shaft” partType=”45″>
</component>
<component name=”Head” description=”Head” partType=”5″>
<component name=”Screw” description=”Screw” partType=”3″>
<component name=”Bristles” description=”Bristles” partType=”4″>
</component>
</product>

You need to update the application to support the creation of an XElement object having a structure that will serialize to the format shown above.
What should you do? (Each correct answer presents part of the solution. Choose two.)

PrepAway - Latest Free Exam Questions & Answers

A.
Insert the following code segment at line PR16 in \Model\Product.cs:
return new XElement(“product, new XAttribute(“name”, this.Name),
new XElement(“description”, this.Description),
new XElement(“productType”, this.ProductType));

B.
Insert the following code segment at line CT14 in \Model\Component.cs:
return new XElement(“component, new XElement(“name”, this.Name),
new XElement(“description”, this.Description),
new XElement(“partType”, this.PartType));

C.
Insert the following code segment at line PR16 in \Model\Product.cs:
return new XElement(“product, new XElement(“name”, this.Name),
new XElement(“description”, this.Description),
new XElement(“productType”, this.ProductType));

D.
Insert the following code segment at line PR16 in \Model\Product.cs:
return new XElement(“product, new XAttribute(“name”, this.Name),
new XAttribute(“description”, this.Description),
new XAttribute(“productType”, this.ProductType));

E.
Insert the following code segment at line CT14 in \Model\Component.cs:
return new XElement(“component, new XAttribute(“name”, this.Name),
new XElement(“description”, this.Description),
new XElement(“partType”, this.PartType));

F.
Insert the following code segment at line CT14 in \Model\Component.cs:
return new XElement(“component, new XAttribute(“name”, this.Name),
new XAttribute(“description”, this.Description),
new XAttribute(“partType”, this.PartType));


Leave a Reply