public override string ToString() { // this method overrides everything in format animal detail,cs and create a string based on the variables read into Chameleon string outPut = String.Empty; // variable to save fromated string in string col = "ColorchangeSpeed "; // string declaring that the value aver it will be swimspeed string reqTemp = "Required environment temperature "; string crawl = "Crawlspeed "; outPut = String.Format("{0,45}{1}{2,15}{3}{4,20}{5}", reqTemp, //var0 RecuiredTemp.ToString(), //var1 crawl, //var2 crawlSpeed.ToString(), //var3 col, //var4 colorChangeSpeed.ToString()); //var5 return(base.ToString() + outPut); // use of baseclass plus data modified in this class }
public override string ToString() { // this method overrides everything in format animal detail,cs and create a string based on the variables read unto seaturtle string outPut = String.Empty; // variable to save fromated string in string swim = "Swimspeed "; // string declaring that the value aver it will be swimspeed string reqTemp = "Required environment temperature "; string crawl = "Crawlspeed "; outPut = String.Format("{0,45}{1}{2,15}{3}{4,15}{5}", reqTemp, //var0 RecuiredTemp.ToString(), //var1 crawl, //var2 crawlSpeed.ToString(), //var3 swim, //var4 SwimSpeed.ToString()); //var 5 return(base.ToString() + outPut); }