debuggingreport.txt

来自「卡耐基教程SSD3中所有exercise和quiz的全部答案」· 文本 代码 · 共 59 行

TXT
59
字号
---------------------------------------------------------------------------
Bug #1

Description of the bug: NumberOfA,numberOfT,numberOfC,numberOfG in the method  countNucleotides is not referenced correctly.


Lines of source code that contain the bug: [86]   int numberOfA = 0;
		                           [87]   int numberOfT = 0;
	                                   [88]   int numberOfC = 0;
		                           [89]   int numberOfG = 0;


Lines of the fixed code:  this.numberOfA = 0;
		          this.numberOfT = 0;
	                  this.numberOfC = 0;
		          this.numberOfG = 0;

---------------------------------------------------------------------------
Bug #2

Description of the bug: The source code is wrong. "C" should be replaced by "G".


Lines of source code that contain the bug:  [104]    numberOfC++;


Lines of the fixed code:  numberOfG++;


---------------------------------------------------------------------------
Bug #3

Description of the bug:"index <= sequence.length() - 1 "  or  "index < sequence.length()"

Lines of source code that contain the bug:  [166]     while (index < sequence.length() - 1) {



Lines of the fixed code:   while (index < sequence.length()) {



---------------------------------------------------------------------------
Bug #4

Description of the bug: The values of "firstNucleotide == input" and "secondNucleotide == input" should be equal to "input" at the same time.


Lines of source code that contain the bug:  [173]    if ((firstNucleotide == input) || (secondNucleotide == input)) {



Lines of the fixed code:   if ((firstNucleotide == input) && (secondNucleotide == input)) {



---------------------------------------------------------------------------

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?