20182324 2019-2020-1 《数据结构与面向对象程序设计》第2、3周学习总结

20182324 2019-2020-1 《数据结构与面向对象程序设计》第2、3周学习总结

教材学习内容总结

1、Scanner 类的使用
2、println、print、printf的用法及区别
3、Java 的数据类型
4、常用类(String 类,Random 类,Math 类等)的使用方法
5、格式化输出的学习与使用

教材学习中的问题和解决过程

  • 问题1:字符不能通过nextChar()输入

  • 问题1解决方案:Scanner类中没有nextChar()方法,可使用charAt(int)返回指定位置的字符。

  • 问题2:git push 推送代码时显示 “ unable to access 'xxxx': Could not resolve host : gitee.com ”

  • 问题2解决方案:经查是虚拟机网络断开所致。

代码调试中的问题和解决过程

  • 问题:格式化输出 “#.###” 当小数位最后为 0 时自动省略
  • 问题解决方案:“ # ”格式化输出不会为 0 占位,可以使用 “#.000” 。

其它问题已记录至博客 实验报告二

代码托管

(statistics.sh脚本的运行结果截图)

上周考试错题总结

  • Which properties are true of String objects?
    A . Their lengths never change
    B . The shortest string has zero length
    C . Individual characters within a String may be changed using the replace method
    D . The index of the first character in a string is one
    E . Only A and B are true
    解析:Strings are immutable. That means that once a string object is created it cannot be changed. Therefore the length of a string never changes once it has been created. The shortest length string is "" there are no characters between the quotes, so the length is zero. The replace method allows you to create a new string from an original one, replacing some of the characters. The index of the first location in a String is zero not one. Also, the last byte of every string contains the end-of-string character which is a byte of low-values, or binary zeros.

  • An "alias" is when
    A . two different reference variables refer to the same physical object
    B . two different numeric variables refer to the same physical object
    C . two different numeric variables contain identical values
    D . two variables have the same names
    E . none of the above
    解析:An "alias" occurs when there are two or more references to the same physical object so that by following either reference, one can read/write/modify the object.

  • These two ways of setting up a String yield identical results

    a) String string = "12345";
    b) String string = 12345;
    A . true
    B . false
    解析:In fact, the second statement won't even compile! The second statement will receive a syntax error about incompatible types. There is no automatic conversion from a number to a String.

  • If you need to import not only the top-level of a package, but all its secondary levels as well, you should write: import package..;
    A . true
    B . false
    解析:The import statement can only be used with a single * (wild card). If you need to import all the secondary levels of a package as well, you must write them out explicitly:
    import package.A.*;
    import package.B.*;

  • The names of the wrapper classes are just the names of the primitive data types, but with an initial capital letter.
    A . true
    B . false
    解析:This is true for most of the wrapper classes, but it is false for int (Integer) and char (Character).

  • Assume that count is 0, total is 20 and max is 1. The following statement will do which of the following? if (count != 0 && total / count > max) max = total / count;
    A . The condition short circuits and the assignment statement is not executed
    B . The condition short circuits and the assignment statement is executed without problem
    C . The condition does not short circuit causing a division by zero error
    D . The condition short circuits so that there is no division by zero error when evaluating the condition, but the assignment statement causes a division by zero error
    E . The condition will not compile because it uses improper syntax
    解析:Since count is 0, (count != 0) is false. Because the left-hand side of an && condition is false, the condition is short circuited, and so the right-hand side is not evaluated. Thus, a potential division by zero error is avoided. Because the condition is false, the statement max = total / count is not executed, again avoiding a potential division by zero error.

  • When executing a program, the processor reads each program instruction from (当执行一个程序时,处理器从___读取每个程序指令)
    A . secondary memory (storage) (辅助存储器(存储))
    B . the Internet (互联网)
    C . registers stored in the processor (储存在处理器中的寄存器)
    D . main memory (主存储器)
    E . could be any of these (可以是以上这些中的任何一个)

  • The word "Public" is a reserved word. ("Public"是一个保留字。)
    A . true
    B . false
    解析:"public" is a reserved word, but since Java is case sensitive, "Public" differs from "public" and therefore "Public" is not a reserved word.

结对及互评

评分标准

  1. 正确使用Markdown语法(加1分):

    • 不使用Markdown不加分
    • 有语法错误的不加分(链接打不开,表格不对,列表不正确...)
    • 排版混乱的不加分
  2. 模板中的要素齐全(加1分)

    • 缺少“教材学习中的问题和解决过程”的不加分
    • 缺少“代码调试中的问题和解决过程”的不加分
    • 代码托管不能打开的不加分
    • 缺少“结对及互评”的不能打开的不加分
    • 缺少“上周考试错题总结”的不能加分
    • 缺少“进度条”的不能加分
    • 缺少“参考资料”的不能加分
  3. 教材学习中的问题和解决过程, 一个问题加1分

  4. 代码调试中的问题和解决过程, 一个问题加1分

  5. 本周有效代码超过300分行的(加2分)

    • 一周提交次数少于20次的不加分
  6. 其他加分:

    • 周五前发博客的加1分
    • 感想,体会不假大空的加1分
    • 排版精美的加一分
    • 进度条中记录学习时间与改进情况的加1分
    • 有动手写新代码的加1分
    • 课后选择题有验证的加1分
    • 代码Commit Message规范的加1分
    • 错题学习深入的加1分
    • 点评认真,能指出博客和代码中的问题的加1分
    • 结对学习情况真实可信的加1分
  7. 扣分:

    • 有抄袭的扣至0分
    • 代码作弊的扣至0分
    • 迟交作业的扣至0分

点评:

  • 博客中值得学习的或问题:

    • 图文并茂,有参考资料
    • markdown 格式运用较为熟练
  • 代码中值得学习的或问题:

    • 代码格式规范,合理使用空白,便于阅读
  • 基于评分标准,我给本博客打分:14分。得分情况如下:

    • 1、正确使用Markdown语法(加1分)
    • 2、模板中的要素齐全(加1分)
    • 3、教材学习中的问题和解决过程(2分)
    • 4、代码调试中的问题和解决过程(1分)
    • 5、本周有效代码超过300分行的(加2分)
    • 6、其他加分:
      • 感想,体会不假大空的加1分
      • 进度条中记录学习时间与改进情况的加1分
      • 有动手写新代码的加1分
      • 代码Commit Message规范的加1分
      • 错题学习深入的加1分
      • 点评认真,能指出博客和代码中的问题的加1分
      • 结对学习情况真实可信的加1分
  • 参考示例

点评过的同学博客和代码

  • 本周结对学习情况
    • 20182329

    • 结对学习内容

      • 条件语句和循环语句的使用
      • 输入语句和输出语句应用
      • 基本数据类型的转换和应用
      • 各种类的使用方法,以及格式化输出的方法。
      • 基本的类的编写

其他(感悟、思考等,可选)

经过这两周的学习实践,我逐渐体会到上学期学习 C 语言所打下的基础,其实 C 语言与 Java 语言虽有不同但也有相通之处,其精髓需要更加细致的学习以逐步体会。

学习进度条

代码行数(新增/累积) 博客量(新增/累积) 学习时间(新增/累积) 重要成长
目标 10000行 30篇 400小时
第一周 109/109 2/2 28/28 学习了Java的基本语法格式,熟练使用 Linux Bash 命令
第二周 550/659 1/3 23/51 学习掌握JDB调试命令
第三周 1028/1687 2/5 30/81 学习类的编写与使用

参考:软件工程软件的估计为什么这么难软件工程 估计方法

  • 计划学习时间:20小时

  • 实际学习时间:30小时

  • 改进情况:

(有空多看看现代软件工程 课件 软件工程师能力自我评价表)

参考资料

posted @ 2019-09-21 13:07  Lolipop  阅读(223)  评论(1编辑  收藏  举报