zoukankan      html  css  js  c++  java
  • 20172329《程序设计与数据结构》第二周学习总结

    2017-2018-20172329 《程序设计与数据结构》第二周学习总结

    教材学习内容总结

    • 可以编写一些程序进行数据的处理,可以初步的实现人机交互。
    • 认识了字符串和一些字符串之间的拼接方式。
    • 在学习变量的时候学会了编写一些可计算的程序,为今后的编程打下基础。

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

    • 问题1:在教材41页例2.4中,在连续输入 的时候总是不知道把引号放在哪里?总是会使得输出的结果错版。
    • 问题1解决方案:在仔细比对书本和自己的编写的程序以后,发现引号出现在开头或者是需要拼接的过程中,比如:" /abcd/ + /efgh/ "
    • 问题2:在书中43页的2.2.1变量讲解内容里,对于变量的定义我遇到了问题。

    "变量声明要求编译器分配足够大的内存单元来保存指定类型的值,并且要定义一个变量名用于访问相应的内存单元。"

    • 问题2解决方案:我查找了资料了解到:“声明一个变量并不一定占用内存空间,声明一个变量只是将变量名标识符的有关信息告诉编译器,使编译器“认识”该标识符,但是声明并不一定引起内存的分配,而定义一个变量意味着给变量分配内存空间,用于存放对应类型的数据,变量名就是对相应的内存单元的命名。”

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

    • 问题1:在学习人机交互编写程序的时候,我发现我在起名字的时候经常会导致如图的这个问题,出现一大堆问题,让我很是烦恼。

    • 问题1解决方案:应该是因为看书不仔细,忘记了命名不应该有空格,并且不能以数字或者大写字母开头,虽然我在书中没有看到这个解决办法,但是我经过长时间的尝试,发现了这个问题,把命名里的空格删去,把数字改去后边,把大写字母改成小写,问题也就随之而然解决了。
      double Doller, Cent, Cent25, Cent10, Cent5, Cent1; int BASE1 = 25, BASE2 = 10, BASE3 = 5, BASE4 = 1, BASE = 100; Scanner scan = new Scanner(System.in); System.out.print("Cent25: "); Cent25 = scan.nextInt(); System.out.print("Cent10: "); Cent10 = scan.nextInt(); System.out.print("Cent5: "); Cent5 = scan.nextInt(); System.out.print("Cent1: "); Cent1 = scan.nextInt(); Doller = (Cent25 * BASE1 + Cent10 * BASE2 + Cent5 * BASE3 + Cent1 * BASE4) * BASE; Cent =Cent25 * BASE1 + Cent10 * BASE2 + Cent5 * BASE3 + Cent1 * BASE4;

    • 问题2:在开始编写代码的时候总是会出现这个问题,如图的问题,而且一出现就是几十条错误提醒,都快要放弃去检查错误。

    • 问题2解决方案:后来经常反复检查,并且加以实验,我发现一般出现这个问题的可能是因为之前或者编写的时候在敲这个名字的时候,哪里多了个字母或者是少了个字母,因为起初我们很多人都会遇到这个问题,所以和很多人交流以后得出了这个结论。

    • 问题3:在学习整型与浮点数中,特别想知道为什么"int","double"会发亮,而"string"不会?

    • 问题3解决方案:查书:double:双精度,浮点型,其实就是用来表示带小数的数字,比如5.5555;
      int:整形,无小数点,只能表示5,不能表示5.0;
      string:字符串类型,一般声明的时候用双引号括起来,如:"Hello You !"。

    [代码托管]

    https://gitee.com/CS-IMIS-23/20172327wwb.git

    上周考试错题总结

    • 错题1: 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(可以是以上这些中的任何一个)

    正确答案: D 我的答案:C 
    

    原因:一开始选的是D,因为在网上查的是储存到CPU,但是后来检查的时候,感觉不对,就改成了C。

    • 错题2:Which memory capacity is the largest? (哪个选项的存储容量最大?)

    A.1,500,000,000,000 bytes (1,500,000,000,000个字节)
    B.100 gigabytes (100千兆字节)
    C.3,500,000 kilobytes (3,500,000千字节)
    D.10 terabyte (10太字节)
    E.12,000,000 megabytes (12,000,000百万字节)

    正确答案: E 我的答案: D 
    

    原因:没有去仔细算...

    • 错题3:Volatility is a property of (易变性是___的性质)

    A.RAM (随机存储器)
    B.ROM (只读存储器)
    C.disk (磁盘)
    D.software (软件)
    E.computer networks (计算机网络)

    正确答案: A 我的答案: D 
    

    原因:网上查找这一方面的资料,根本看不到易变性,还是看书有用

    • 错题4:The ability to directly obtain a stored item by referencing its address is known as (通过引用地址直接获得存储项的能力被称为___)

    A.random access (随机存取)
    B.sequential access (顺序存取)
    C .read-only access (只读访问)
    D.fetch access (获取访问)
    E.volatility (易变性)

    正确答案: A 我的答案: B 
    

    原因:没有仔细看书

    • 错题5:It is important to dissect a problem into manageable pieces before trying to solve the problem because (试图解决问题之前,把一个问题分解成可控制的几部分是很重要的,因为)

    A.most problems are too complex to be solved as a single, large activity (大多数问题太复杂,以至于不能作为一个单独大型的活动来解决)
    B.most problems are solved by multiple people and it is easy to assign each piece to a separate person (大多数问题都是由很多人解决的而且把每一部分分配给不同的人是很容易的)
    C.it is easier to integrate small pieces of a program into one program than it is to integrate one big chunk of code into one program (将程序的小部分整合到一个程序中比将一大块代码整合到一个程序中更容易)
    D.our first solution may not solve the problem correctly (我们的第一个方案可能无法正确解决问题)
    E.all of the above (以上皆是)

    正确答案: A 我的答案: E 
    

    原因:理解不够充分

    • 错题6:Java is an example of a(n) (Java是一个___的例子)

    A.machine language (机器语言)
    B.assembly language (汇编语言)
    C.high-level language (高级语言)
    D.fourth generation language (第四代语言)
    E.both C and D (C和D都是)

    正确答案: E 我的答案: C 
    

    原因:发现C是对的,没有看E,读题不细致。

    • 错题7:The line of Java code "// System.out.println("Hello");" will (Java的这行代码将会)

    A.do nothing (什么都不做)
    B.cause "Hello" to be output (输出"Hello")
    C.cause a syntax error (造成语法错误)
    D.cause "(Hello)" to be output (输出"(Hello)")
    E .there is no way to know without executing this line of code (不执行这行代码就无法知道)

    正确答案: A 我的答案: E 
    

    原因:看书没有看到这里,资料也没有查到。

    • 错题8:The instruction: System.out.println("Hello World"); might best be commented as (这个指令最好被注释为)

    A .// prints "Hello World" to the screen (将"Hello World"打印到屏幕上)
    B .// prints a message (打印一条信息)
    C .// used to demonstrate an output message (用来演示输出信息)
    D.//
    E.// meaningless instruction (没有意义的指令)

    正确答案: C 我的答案: B 
    

    原因:我的理解是B,但是C这个选项,感觉就是很简明。

    • 错题9:Which character below is not allowed in an identifier? (下面哪个字符不允许在标识符中使用?)

    A.$
    B._
    C .0 (zero)(零)
    D .q
    E .^

    正确答案: E 我的答案: C 
    

    原因:对知识点掌握不够。

    • 错题10:Which of the following is a legal Java identifier? (下面哪个是合法的Java标识符?)

    A .i
    B .class
    C .ilikeclass!
    D .idon'tlikeclass
    E .i-like-class

    正确答案: A 我的答案: B 
    

    原因:看书上写的class就是标识符,但网上说它是保留字。

    • 错题11:A unique aspect of Java that allows code compiled on one machine to be executed on a machine of a different hardware platform is Java's (Java的独特之处在于其___,它允许在一台机器上编译的代码在不同的硬件平台上执行)

    A .bytecodes (字节码)
    B .syntax (语法)
    C .use of objects (所使用的对象)
    D .use of exception handling (所使用的异常处理)
    E .all of the above (以上皆是)

    正确答案: A 我的答案: C 
    

    原因:对“面向对象”理解不透彻。

    • 错题12:An error in a program that results in the program outputting $100 instead of the correct answer, $250 is (程序中的一个错误导致程序输出结果是$100而不是正确答案$250,这是)

    A .a programmer error (程序错误)
    B .a syntax error (语法错误)
    C .a run-time error (运行时错误)
    D .a logical error (逻辑错误)
    E .a snafu (混乱)

    正确答案: D 我的答案: B 
    

    原因:对错误分析不是很熟悉。

    • 错题13:Which of the following is true regarding Java syntax and semantics? (关于Java的语法和语义,下列哪一项是正确的?)

    A .a Java compiler can determine if you have followed proper syntax but not proper semantics (Java编译器可以判定你是否遵循正确的语法,但不能判定正确的语义)
    B .a Java compiler can determine if you have followed proper semantics but not proper syntax (Java编译器可以判定你是否遵循正确的语义,但不能判定正确的语法)
    C .a Java compiler can determine if you have followed both proper syntax and semantics (Java编译器可以判定你是否遵循正确的语义和语法)
    D .a Java compiler cannot determine if you have followed either proper syntax or semantics (Java编译器不能判定你是否遵循正确的语义或语法)
    E .a Java compiler can determine if you have followed proper syntax and can determine if you have followed proper semantics if you follow the Java naming convention rules (如果你遵循Java的命名规范,Java编译器就可以判定你是否遵循正确的语法,并且可以判定你是否遵循正确的语义)

    正确答案: A 我的答案: E 
    

    原因:当时做到最后题目好长,看不下去了。

    • 错题14:Which of the following would be a good variable name for the current value of a stock? (下面哪个是关于变量“current value of a stock”的最佳命名?)

    A .curstoval
    B .theCurrentValueOfThisStockIs
    C .currentStockVal
    D .csv
    E .current

    正确答案: C 我的答案: A 
    

    原因:看书的时候跳过看这里了。

    • 错题15:A color image is broken down into individual pixels (points), each of which is represented by (一个彩色图像被分解成单个像素(点),其中每个像素表示)

    A .a 1 for white and a 0 for black (白色的1和黑色的0)
    B .3 values denoting the intensity of red, green, and blue in the image (3个表示图像中红、绿和蓝色的亮度值)
    C .a single number indicating the intensity of color between white and black (一个单独的数字,它表示白色和黑色之间的颜色亮度)
    D .two numbers, a value that denotes where between white and black the color is, and a brightness (两个数字,一个表示白色和黑色之间的颜色,另一个表示亮度)
    E .none of the above, it is not possible to represent a color image (以上都不是,不可能表示一个彩色图像)

    正确答案: B 我的答案: A
    原因:在AB里纠结好久,还是选错了。

    • 错题16:In a Java program, dividing by 0 is a syntax error. (在Java程序中,除以0是一个语法错误。)

    A .true

    B .false
    原因:理解不透彻。

     正确答案: B 我的答案: A 
    

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

    • 我发现学习Java不一定就是代码行数多就可以,在第一周的学习过程中,我发现我对于书本上的知识都是模糊的,很多都是这个星期才搞定的,所以我意识到了看书的重要性。
    • Java学习让我感觉学习它就像是手速脑力的融会贯通,每一次自己写完一个程序以后,发现可以运行后,喜悦感就像是高三解出来了圆锥曲线一样的兴奋。

    学习进度条

    代码行数(新增/累积) 博客量(新增/累积) 学习时间(新增/累积)
    目标 5000行 30篇 400小时
    第一周 156/156 1/1 15/15
    第二周 217/371 2/2 20/35

    参考资料

    Java程序设计

  • 相关阅读:
    JavaScript 【引用类型】RegExp类型
    JavaScript【引用类型】Function 类型
    JavaScript【引用方法】归并方法
    JavaScript【引用方法】迭代方法
    JavaScript【引用方法】位置方法
    【华为云技术分享】MongoDB经典故障系列一:数据库频繁启动失败怎么办?
    【华为云技术分享】Python面试的一些心得,与Python练习题分享
    【华为云技术分享】Linux内核发展史 (1)
    【华为云技术分享】Spring Boot 最流行的 16 条实践解读!
    【华为云技术分享】opensuse使用zypper安装软件
  • 原文地址:https://www.cnblogs.com/qh45wangwenbin/p/8592153.html
Copyright © 2011-2022 走看看