四则运算

时间:2021-04-12 11:55:48   收藏:0   阅读:0

第一步:制定项目目标,以及项目最终预计能到达效果,自动生小学四则运算题目的命令行

第二步:分别满足下面的各种要求

第三步:增加一个运算符,程序应该有怎样的变化,要不要重写,或只改部分代码

第四步:选择一个方向,扩展程序

 部分代码:

 public void jisuan(double a, string operation1,double b, string operation2,double c, string rightanswer)
        {
            bool aa = false;
            if (operation1 == "+" || operation1 == "-")
            {
                if (operation2 == "*" || operation2 == "/")
                {
                    aa = true;
                }
                else
                {
                    aa = false;
                }
            }
            else
            {
                aa = false;
            }
            if (aa == true
评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!