Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4.  
  5. namespace AquariumAdventure
  6. {
  7. public class Fish
  8. {
  9. public string Name { get; set; }
  10. public string Color { get; set; }
  11. public int Fins { get; set; }
  12.  
  13. public Fish(string name, string color, int fins)
  14. {
  15. this.Name = name;
  16. this.Color = color;
  17. this.Fins = fins;
  18. }
  19.  
  20. public override string ToString()
  21. {
  22. var fishInfo = new StringBuilder();
  23. fishInfo.AppendLine($"Fish: {Name}");
  24. fishInfo.AppendLine($"Color: {Color}");
  25. fishInfo.AppendLine($"Number of fins: {Fins}");
  26. return fishInfo.ToString();
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement