Created
April 14, 2016 20:13
-
-
Save yurii-litvinov/e8fc33144ebbe1a823c9197eaf754f7f to your computer and use it in GitHub Desktop.
code review example 4 - NodeOperand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace ParseTree | |
{ | |
public class NodeOperand : Node | |
{ | |
private double value; | |
/// <summary> | |
/// Initializes a new instance of the class. | |
/// </summary> | |
/// <param name="value"></param> | |
public NodeOperand(double value) | |
{ | |
this.value = value; | |
} | |
public void Print() | |
{ | |
Console.Write(string.Format(" {0} ", this.value)); | |
} | |
public double Calculate() | |
{ | |
return value; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment