编程作业

这个作业属于哪个课程 https://edu.cnblogs.com/campus/zswxy/computer-science-class3-2018/homework/11879
这个作业要求在哪里 https://edu.cnblogs.com/campus/zswxy/computer-science-class3-2018/homework/11879
这个作业的目标 熟悉码云掌握一些简单的操作以及对于输入词汇的检索
学号 20188480

Github地址:

https://gitee.com/arthur-w

PSP表格:

PSP2.1 Personal Software Process Stages 预估耗时(分钟) 实际耗时(分钟)
Planning 计划 20 35
• Estimate • 估计这个任务需要多少时间 300 500
Development 开发 200 300
• Analysis • 需求分析 (包括学习新技术) 60 120
• Design Spec • 生成设计文档 20 30
• Design Review • 设计复审 20 20
• Coding Standard • 代码规范 (为目前的开发制定合适的规范) 30 40
• Design • 具体设计 30 30
• Coding • 具体编码 200 200
• Code Review • 代码复审 30 30
• Test • 测试(自我测试,修改代码,提交修改) 30 30
Reporting 报告 30 30
• Test Repor • 测试报告 20 30
• Size Measurement • 计算工作量 30 30
• Postmortem & Process Improvement Plan • 事后总结, 并提出过程改进计划 30 30
合计 1050 1455

解题思路描述

每个功能分别对应一个功能模块。

代码规范链接

https://gitee.com/arthur-w/project-java/blob/master/codestyle.md

设计与实现过程

       Map<String,Integer> map = new HashMap<>();
        for (String item : lists) {
            Integer count = 1;
            if (map.get(item)!=null) {
                count = map.get(item) + 1;
            }
            map.put(item,count);
        }
        while (value != null) {
        	if(!"".equals(value)) {
        	   i++;
        	}
            value=in.readLine();
        }
        if (in!= null)
			in.close();
		
        System.out.println("lines: "+i);
        while ((read = buff.read()) != -1) { 
        	if(read>=32&&read<=126) {   //统计字符数
        		charCount++;
        	}
        }
        
        buff.close();
   
        System.out.println("characters: " + charCount);

单元测试

问题

在统计文件中各单词的出现次数时还是有碰到很大问题。
然后在度娘的帮助下,把每个单词以及其出现的次数放入map,后来慢慢摸索也解决了问题。

心路历程

对于码云的一些操作不是很熟悉,代码方面也有些许问题,以后代码量还是不能过少。

posted on 2021-04-02 16:49  营业执照  阅读(48)  评论(0编辑  收藏  举报