You are integrating third-party data into a Virtual Earth 6.0 application. The data that is retrieved from the third party is stored in an array named Results. The Results array is stored inside a Web handler. The data is stored in the following format.
R esults[0][“name”] = “A. Datum Corporation”;
Results[0][“address”] = ” 123 Main St. , New York , NY “; Results[0][“latitude”] = “40.123”;
Results[0][“longitude”] = “-70.456”;
Results[0][“thumbnail”] = “http://www.adatum.com/st3465.jpg”; …
Results[x]
The Web handler uses the GeoRSSFeed class to accept items of type GeoRSSItem. The class contains the
ToString() method that writes the GeoRSS feed to a string.
The Web handler GeoRSS integration is defined by the following code segment. (Line numbers are included for reference only.)
01 GeoRSSFeed feed = new GeoRSSFeed();
02 GeoRSSItem curItem;
03 for (int i = 0; i < Results.length; i++){
04 curItem = new GeoRSSItem();
05 …
06 feed.Add(curItem);
07 }
08 // Write feed to HTTP Response
09 context.Write(feed.ToString());
The Web handler uses the GeoRSSItem class that contains the following code segment. (Line numbers are included for reference only.)
10 public class GeoRSSItem {
11 public Dictionary < string, string > elements;
12 publ ic GeoRSSItem(){
13 elements = Dictionary < string, string > ();
14 }
15 public void Add(string pName, string pValue){
16 elements.Add(pName, pValue);
17 }
18 }
You need to encode the data inside the Results array into the GeoRSS format.
Which code segment should you insert at line 05?
A.
String [] keys = Results[i].Keys; String curKey; For (int i = 0; i < keys.length; i++){ curKey = keys[i]; curItem.Add(curKey, Results[i][curKey]); }
B.
curItem.Add(“title”, Results[i][“name”]); curItem.Add(“description”, Results[i][“address”]); curItem.Add(“latitude”, Results[i][“latitude”]); curItem.Add(“longitude”, Results[i][“longitude”]); curItem.Add(“icon”, Results[i][“thumbnail”]);
C.
curItem.Add(“title”, Results[i][“name”]); curItem.Add(“description”, string.Format(“{0}|{1}”, _ Results[i][“address”], _ Results[i][“thumbnail”]); curItem.Add(“latitude”, Results[i][“latitude”]); cur Item.Add(“longitude”, Results[i][“longitude”]);
D.
curItem.Add(“name”, Results[i][“name”]);
curItem.Add(“address”, string.Format(“{0}|{1}”, _
Results[i][“address”], _
Results[i][“thumbnail”]);
curItem.Add(“latitude”, Results[i][“latitude”]);
curItem.Add(“longitude”, Results[i][“longitude”]);