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程序設計

相關文章
相關標籤/搜索