You are testing a component that serializes the Meeting class instances so that they can be saved to the file system

You are testing a component that serializes the Meeting class instances so that they can be
saved to the file system. The Meeting class has the following definition:
public class Meeting {
private string title;
public int roomNumber;
public string[] invitees;
public Meeting(){
}
public Meeting(string t){
title = t;
} }
The component contains a procedure with the following code segment.
Meeting myMeeting = new Meeting(“Goals”);
myMeeting.roomNumber = 1100;
string[] attendees = new string[2]{“Braindumps”, “Mary”};
myMeeting.invitees = attendees;
XmlSerializer xs = new XmlSerializer(typeof(Meeting));
StreamWriter writer = new StreamWriter(@"C:\Meeting.xml");
Xs.Serialize(writer, myMeeting);
writer.Close();
You need to identify the XML block that is written to the C:\Meeting.xml file as a result of running
this procedure. Which XML block represents the content that will be written to the C:\Meeting.xml
file?


A. <?xml version="1.0" encoding="utf-8"?>
    <Meeting xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <title>Goals</title>
    <roomNumber>1100</roomNumber>
    <invitee>Braindumps</invitee>
    <invitee>Mary</invitee>
    </Meeting>
B. <?xml version="1.0" encoding="utf-8"?>
    <Meeting xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <roomNumber>1100</roomNumber>
 <invitees>
    <string>Braindumps</string>
    <string>Mary</string>
    </invitees>
    </Meeting>
C. <?xml version="1.0" encoding="utf-8"?>
    <Meeting xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    title="Goals">
    <roomNumber>1100</roomNumber>
    <invitees>
    <string>Braindumps</string>
    <string>Mary</string>
    </invitees>
    </Meeting>
D. <?xml version="1.0" encoding="utf-8"?>
    <Meeting xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <roomNumber>1100</roomNumber>
    <invitees>
    <string>Braindumps</string>
    </invitees>
    <invitees>
    <string>Mary</string>
  </invitees>
    </Meeting>

Answer: B 

No comments:

Post a Comment