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 Exercise2a
- {
- class Tree
- {
- public string Type { get; set; }
- public double Diameter { get; set; }
- public static string Color { get; set; }
- public static int Counter { get; private set; }
- public Tree()
- :this("Default", 0.0)
- {
- }
- public Tree(string type, double diameter)
- {
- Type = type;
- Diameter = diameter;
- Counter++;
- }
- public Tree(double diameter, string type)
- :this(type, diameter)
- {
- }
- public override string ToString()
- {
- return String.Format("Type = {0}, Diamater = {1}, Color = {2}", Type, Diameter, Color);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement