using System.Collections.Generic;
public Transformer(string name, string affiliation, int strength, int intelligence, int speed, int endurance, int rank, int courage, int firepower, int skill)
Affiliation = affiliation;
Intelligence = intelligence;
public Transformer(string name, int strength, int intelligence, int speed, int endurance, int rank, int courage, int firepower, int skill)
:this(name, "Unknown", strength, intelligence, speed, endurance, rank, courage, firepower, skill) { }
Console.WriteLine($"The {AffiliationName} has the following stats: strength={Strength}, intelligence={Intelligence}, speed={Speed}, endurance={Endurance}, Rank={Rank}, and so on...");
public string Name { get; set; }
public string Affiliation { get; set; }
public string AffiliationName
return $"{Affiliation} {Name}";
var parts = value.Split(" ");
if (parts.Length != 2) throw new Exception("Invalid entry");
public int Strength { get; set; }
public int Intelligence { get; set; }
public int Speed { get; set; }
public int Endurance { get; set; }
public int Rank { get; set; }
public int Courage { get; set; }
public int Firepower { get; set; }
public int Skill { get; set; }
static void Main(string[] args)
var transformers = new List<Transformer>();
var optimus = new Transformer("Optimus Prime", "Autobot", 10, 10, 8, 10, 10, 10, 8, 10);
transformers.Add(optimus);
var megatron = new Transformer("Megatron", "Decepticon", 10, 10, 4, 8, 10, 9, 10, 9);
transformers.Add(megatron);
var bumblebee = new Transformer("Bumblebee", "Autobot", 2, 8, 4, 7, 7, 10, 1, 7);
transformers.Add(bumblebee);
var starscream = new Transformer("Star Scream", "Decepticon", 7, 9, 10, 7, 9, 9, 8, 8);
transformers.Add(starscream);
var unicron = new Transformer("Unicron", 10, 10, 10, 10, 10, 10, 10, 10);
transformers.Add(unicron);
unicron.AffiliationName = "robot Unicron";
for (var i = 0; i < transformers.Count; i++)