课后作业二

码云没有用明白

C#实现

代码一共47

支持两个数的四则运算

实现时间:

Psp2.1

Personal software process stages

预计耗时(分钟)

实际耗时(分钟)

Planning

计划

10

5

Estimate

估计这个任务需要多少时间

10

1

Development

开发

 

 

Analysis

需求分析 (包括学习新技术)

 

 

Design Spec

生成设计文档

 

 

Design Review

设计复审

 

 

Coding Standard

代码规范 (为目前的开发制定合适的规范)

 

 

Design

具体设计

 

 

Coding

具体编码

180

120

Code Review

代码复审

 

 

Test

测试(自我测试,修改代码,提交修改)

20

10

Reporting

报告

10

5

Test Repor

测试报告

 

 

Size Measurement

计算工作量

 

 

Postmortem & Process Improvement Plan

事后总结, 并提出过程改进计划

 

 

 

 

合计230

141

代码如下:

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

 

namespace Calculate

{

    class Program

    {

        static void Main(string[] args)

        {

            int a = 0;

            int b = 0;

            int result = 0;

            string cal;

            Console.WriteLine("请输入数字:");

            a = int.Parse(Console.ReadLine());

            Console.WriteLine("请输入运算符:");

            cal = Console.ReadLine();

            Console.WriteLine("请输入数字: ");

            b = int.Parse(Console.ReadLine());

            switch (cal)

            {

                case "+":

                    result = a + b;

                    break;

                case "-":

                    result = a - b;

                    break;

                case "*":

                    result = a * b;

                    break;

                case "/":

                    result = a / b;

                    break;

            }

            Console.WriteLine("结果是:" + result.ToString());

            Console.ReadKey();

 

 

        }

 

 

 

    }

}

posted on 2018-09-19 21:15  Ginger_大姜  阅读(91)  评论(0编辑  收藏  举报