Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
368
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 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 Fish(string name, string color, int fins)
  10.         {
  11.             this.Name = name;
  12.             this.Color = color;
  13.             this.Fins = fins;
  14.         }
  15.  
  16.         public string Name { get; set; }
  17.         public string Color { get; set; }
  18.         public int Fins { get; set; }
  19.  
  20.         public override string ToString()
  21.         {
  22.             StringBuilder sb = new StringBuilder();
  23.             sb.AppendLine($"Fish: {this.Name}");
  24.             sb.AppendLine($"Color: {this.Color}");
  25.             sb.AppendLine($"Number of fins: {this.Fins}");
  26.             return sb.ToString().Trim();
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement