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 ref
class Meeting {
private :
String^ title;
public :
int roomNumber;
array<String^>^ invitees;
Meeting(){}
Meeting(String^ t){
title = t;
} };
The component contains a procedure with the following code segment.
Meeting^ myMeeting = gcnew Meeting(“Goals”); myMeeting->roomNumber = 1100;
array<String^>^ attendees = gcnew array<String^>(2)
{“Braindumps”, “Mary”}; myMeeting->invitees = attendees;
XmlSerializer^ xs = gcnew XmlSerializer(__typeof(Meeting));
StreamWriter^ writer = gcnew 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