Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Forest
- {
- class Tree
- {
- //private string type;
- //public string Type
- //{
- // get { return type; }
- // set { type = value; }
- //}
- //private static int counter = 0;
- //public static int Counter {
- // get { return counter; }
- //}
- public static int Counter { get; private set; }
- public string Type { get; set; }
- public double Diameter { get; set; }
- public double Height { get; set; }
- public static string Color { get; set; }
- static Tree()
- {
- Color = "Green";
- }
- public Tree(string type, double diameter, double height)
- {
- Type = type;
- Diameter = diameter;
- Height = height;
- Counter++;
- }
- public void Introduce()
- {
- Console.WriteLine("Type = {0}, Diameter = {1}, Height = {2}, Color = {3}", Type, Diameter, Height, Color);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement