Kizspy | Question: 35 (Choose 1 answer)
public record Phone{
public string Name{ get; set; } public double Price { get; set; } }
class Program{
static void Main(string[] args){
string phoneXML = @"<ArrayOfPhone><Phone><Name>Nokia</Name><Price>15.5</Price></Phone><Phone><Name>Samsung</Name><Price>11.5</Price></Phone></ArrayOfPhone>";
FUOVERFL
}
}
var xs = new XmlSerializer(typeof(List<Phone>));var phones = (List<Phone>)xs. Deserialize(new StringReader(phoneXML));Console.WriteLine($"{phones. Average(p=>p.Price)}");Console.ReadKey();
Which one of the following is the output of the above code?
A. 13.5
Β. 15.5
C. 11.5
D. 27.0