Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Box
- {
- private string name;
- private double[] sides;
- public Box(string name, double[] sides)
- {
- this.name = name;
- this.sides = sides;
- }
- public Box(string name)
- {
- this.name = name;
- }
- public double GetVolume()
- {
- return this.sides[0] * this.sides[1] * this.sides[2];
- }
- public void Print()
- {
- Console.WriteLine("{0} кутия със страни {1} x {2} x {3} има обем {4}",
- this.name, this.sides[0], this.sides[1], this.sides[2], this.GetVolume());
- }
- public void Print(string name)
- {
- Console.WriteLine("Името на кутията е {0}", name);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement