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

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

教材学习内容总结

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

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

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

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

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

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

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

    git

  • 问题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"不会?less

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

[代码托管]

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

上周考试错题总结

  • 错题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。fetch

  • 错题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程序设计

相关文章
相关标签/搜索