svetlyoek

Untitled

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