Advertisement
lomdim

Untitled

Apr 25th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace simester_b_1
  8. {
  9. class Ship : Vehicle
  10. {
  11. private int length;
  12. private string name;
  13.  
  14. public Ship (string name, GazType gaz_type,int length):base(-1, gaz_type)
  15. {
  16. this.name = name;
  17. this.length = length;
  18.  
  19. }
  20.  
  21. public int Length
  22. {
  23. get { return length; }
  24. }
  25.  
  26. public string Name
  27. {
  28. get { return name; }
  29. set { name = value; }
  30. }
  31.  
  32. public override void Print()
  33. {
  34. Console.WriteLine("Ship name is {0}",Name);
  35. Console.WriteLine("Rides on {0}",Gaz_type);
  36. Console.Write("Ship length is {0} ",Length);
  37. for (int i = 0; i < Length; i++)
  38. {
  39. Console.Write("*");
  40. }
  41. Console.WriteLine();
  42. }
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement