标题:C# 新手请求计算器中代码的解释
取消只看楼主
学士枫人
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2011-6-13
 问题点数:0 回复次数:1 
C# 新手请求计算器中代码的解释
public void RecordSign(string sign)//定义函数
        {
            FirstInput = true;
            
            if (LastSign == "")
            {
                OperandA = Convert.ToDouble(txtResult.Text);

            }
            else
            {
                operations();
                txtResult.Text = OperandA.ToString();
            }

            LastSign = sign;
        }
        private void btnPlus_Click(object sender, EventArgs e)
        {
            RecordSign("+");
        }
        private void btnSub_Click(object sender, EventArgs e)
        {
            RecordSign("-");
        }
        private void btnMul_Click(object sender, EventArgs e)
        {
            RecordSign("*");
        }
        private void btnDiv_Click(object sender, EventArgs e)
        {
            RecordSign("/");
        }
         请求 定义函数 中代码的解释;;;;;
       感谢!!!!!!1
搜索更多相关主题的帖子: 计算器 private 
2011-06-14 11:29
学士枫人
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2011-6-13
得分:0 
public void operations()
        {
            switch (LastSign)
            {
                case "+": OperandA += OperandB; break;
                case "-": OperandA -= OperandB; break;
                case "*": OperandA *= OperandB; break;
                case "/": OperandA /= OperandB; break;
                default:
                    break;
            }
        }


    谢谢有心人,对了 就是这个、、、
2011-06-14 17:35



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-342773-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.060986 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved