AwesomeComputers.CPU128.CalculateSquareNumber C# (CSharp) 메소드

CalculateSquareNumber() 공개 메소드

public CalculateSquareNumber ( ) : int
리턴 int
        public int CalculateSquareNumber()
        {
            int valueFromTheRam = this.ram.LoadValue();
            if (valueFromTheRam < 0)
            {
                throw new ArgumentException("Number too low.");
            }
            else if (valueFromTheRam > 2000)
            {
                throw new ArgumentException("Number too high.");
                // TODO:  Catch the exception and draw it with the video card
            }
            else
            {
                return valueFromTheRam * 2;
                // TODO: use this later at the rendering: string.Format("Square of {0} is {1}.", valueFromTheRam, value)
            }
        }