📄 takeassmcmd[1].html
字号:
<html>
<head>
<link rel=stylesheet href="/css/cteform.css" type="text/css">
<title>Take Assessment: Practical Quiz 2 © 2002-2007 iCarnegie, Inc. - UI Version 3.19</title>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache"><META HTTP-EQUIV="Expires" CONTENT="-1"><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"><script language="JavaScript" src="/js/cteform.js"></script>
<script language="JavaScript" src="/js/ctecoursespt.js"></script>
<script language="JavaScript" src="/js/cteajax.js"></script>
<script language="JavaScript">
function FetchReferencedContent(questionName, referencedName)
{
var cmd =
"https://www.icarnegie.com:443/fetchrefcontentcmd.php?id=12959222" + "&question_name=" + encodeURIComponent(questionName)
+ "&name=" + encodeURIComponent(referencedName);
var winName = questionName + referencedName.replace(/\./g, "_");
window.open(cmd,
winName.replace(/-/g, "_"),
"height=600,width=700,toolbar=no,menubar=no,location=no,status=no,resizable,scrollbars").focus();
}
function ResetTarget()
{
var f = document.forms["Assm"];
f.target = "";
}
function SetUploadTime(targetCmd, questionId, enableReadyForGrading)
{
var f = document.forms["Assm"];
f.action = targetCmd;
var elt = f.elements["client_time"];
if (typeof(elt) != 'undefined') {
var now = new Date();
elt.value = CreateSortableDate(now.getUTCFullYear(),
now.getUTCMonth() + 1,
now.getUTCDate(),
now.getUTCHours(),
now.getUTCMinutes(),
now.getUTCSeconds());
}
if (f.elements["file_to_add_" + questionId].value == '') {
alert('Please specify a file to upload.');
return false;
}
if (enableReadyForGrading) {
elt = f.elements["ready_for_grading"];
if (typeof(elt) != 'undefined') {
elt.disabled = false;
}
var now = new Date();
f.target = now.getUTCFullYear()
+ '_' + (now.getUTCMonth() + 1)
+ '_' + now.getUTCDate()
+ '_' + now.getUTCHours()
+ '_' + now.getUTCMinutes()
+ '_' + now.getUTCSeconds();
var w =
window.open("",
f.target,
"height=300,width=500,toolbar=no,menubar=no,scrollbars=no,resizable=yes");
w.focus();
}
else {
f.target = "";
}
return true;
}
</script></head><body onload="">
<span class=dialogueheader>Take Assessment: Practical Quiz 2</span><br><br>
<form name="Assm" id="Assm" method=POST action="https://www.icarnegie.com:443/submitassmcmd.php" enctype="multipart/form-data">
<td width=5><br></td><a name="top_of_page"></a><table><tr>
<input type=hidden name="object_id" id="object_id" value='13001846' ></tr></table>
<table><tr>
<td width=5><br></td> <td class=td0_instructions align=left valign=top >
<span class=instructions >Please answer the following question(s).<br />
If the assessment includes multiple-choice questions, click the "Submit Answers" button when you have completed those questions.</span></td>
</tr></table>
<table><tr>
<td width=5><br></td><script language="JavaScript">document.write('<td class=instructions>' + 'You have 120 minutes to take this assessment.' + '<br>' + 'Please complete this assessment by ' + ComputeLocalDate('2007-10-22 08:07:16 UTC') + '.' + '</td>');</script> <input type=hidden name="MAX_FILE_SIZE" id="MAX_FILE_SIZE" value='512000' ><td width=5><br></td></tr></table>
<a name="top_9709441"></a><table><tr>
<td width=5><br></td> <td class=td0_highlight-label width=12 align=right valign=top nowrap >
<span class=highlight-label >1.</span></td>
<td width=5><br></td> <td valign=top class=td0_x align=left > <a href="#9709441">Go to bottom of question.</a> </td>
</tr></table>
<table><tr>
<td width=5><br></td> <td valign=top class=td0_x align=left > <!-- new pg 042903 ici -->
<h2 align="center"><cite>Debugging Class DNASequence</cite></h2>
<h3>Prerequisites, Goals, and Outcomes</h3>
<blockquote> <b><i>Prerequisites:</i></b> Before you begin this exercise, you
need mastery of the following:
<ul>
<li> <i>Debugger</i>:
<ul>
<li>Knowledge of a debugger tool</li>
<li>Knowledge of basic techniques of debugging</li>
</ul>
</ul>
<p> <b><i>Goals:</i></b> Reinforce your ability to debug and fix errors efficiently
<p> <b><i>Outcomes:</i></b> You will master the following skills:
<ul>
<li>Use a debugger tool to monitor the behavior of a program.
<li>Apply techniques of debugging to find and fix errors efficiently.
</ul>
</blockquote>
<h3>Background</h3>
<p>The purpose of this assessment is to practice your debugging skills using a
debugger. After you finish this assessment, you should be able to use a debugger
to monitor the execution of your code and fix errors more efficiently.</p>
<h3>Description</h3>
<p>The class <code>DNASequence</code> has methods to examine a DNA sequence.
DNA is a polymer composed of four molecules called nucleotides:
adenine (A), cytosine (C), guanine (G)
and thymine (T). In a computer, a DNA sequence can be represented
as a sequence of the characters <code>'A'</code>, <code>'C'</code>, <code>'G'</code>
and <code>'T'</code>:</p>
<p align="center"><code>"ACCCGGTTTGGCAAATGGGACGGGAGGACGGGGAAAATTACTACGGCATTAGC"</code></p>
<p>The class <code>DNASequence</code> stores the sequence of characters in an
object of class <a href="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" target="externalWindow"><code>String</code></a>.
<code>DNASequence</code> uses the following methods from <code>String</code>:</p>
<ul>
<li><code><a href="http://java.sun.com/j2se/1.5/docs/api/java/lang/StringBuffer.html#charAt(int)" target="externalWindow"><em>char
charAt(int index)</em></a></code>. Obtains the character indicated by the
<code>index</code> argument. The first character of a string buffer is at
index <code>0</code>. The <code>index</code> argument must be greater than
or equal to <code>0</code>.</li>
</ul>
<ul>
<li><code><a href="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html#length()" target="externalWindow"><em>int
length()</em></a></code>. Obtains the number of characters in the string.</li>
</ul>
<p>In addition to the constructor and accessor methods, the class <code>DNASequence</code>
has the following methods:</p>
<ul>
<li><code><em>private void countNucleotides()</em></code>. Sets fields <code>numberOfA</code>,
<code>numberOfT</code>, <code>numberOfC</code> and <code>numberOfG</code>
to the number of occurrences of each nucleotide in the DNA sequence.
<p>For example, if the DNA sequence is <code>"ATCGAAC"</code>, after
call the method <code>countNucleotides,</code> field <code>numberOfA</code>
will have the value 3, field <code>numberOfT</code> will have the value
1, field <code>numberOfC</code> will have the value 2, and field <code>numberOfG</code>
will have the value 1.</p>
</li>
<li><code><em>public boolean twoConsecutive(char input)</em></code>. Indicates
whether the nucleotide specified by the argument <code>input</code> appears
in two consecutive locations in the DNA sequence.
<p>For example, if the DNA sequence is
<code>"ATCGAAC"</code>, the result of <code>twoConsecutive('A')</code>
will be <code>true</code> and the result of <code>twoConsecutive('C')</code>
will be <code>false</code>.</p>
</li>
</ul>
<h3>Files</h3>
<p>Following is a list of files needed to complete this assessment:</p>
<ul>
<li><cite><a href="/content/SSD/SSD3/4.2.0.1/normal/pg-class-dsgn/pg-java-apps/assm-qz-pr-debug/pool-pr-debug/qn-pr-debug-dna/handout/DNASequence.java" target="externalWindow">DNASequence.java</a></cite>.
This is a source file of class <code>DNASequence</code> that contains errors.</li>
<li><cite><a href="/content/SSD/SSD3/4.2.0.1/normal/pg-class-dsgn/pg-java-apps/assm-qz-pr-debug/pool-pr-debug/qn-pr-debug-dna/handout/DebuggingReport.txt" target="externalWindow">DebuggingReport.txt</a></cite>.
This is a template for reporting your diagnosis of each error and your solutions.</li>
</ul>
<h3>Tasks</h3>
<p>The implementation of class <code>DNASequence</code> has four errors. Use a
debugger to help you to debug the program and fix the errors. To locate each
error, you should follow the process described in page <a href="javascript:ContentByName('pg-debug');">1.1.8 Debugging</a>.</p>
<p> Maintain a record of your work in the file <cite><a href="/content/SSD/SSD3/4.2.0.1/normal/pg-class-dsgn/pg-java-apps/assm-qz-pr-debug/pool-pr-debug/qn-pr-debug-dna/handout/DebuggingReport.txt" target="externalWindow">DebuggingReport.txt</a></cite>.
Include your diagnosis of each error and your solutions.</p>
<h3>Submission</h3>
<p>Upon completion, submit <strong>only</strong> the following.</p>
<ol>
<li><code><cite>DNASequence.java</cite></code>. The "fixed" version of <em>DNASequence.java</em></li>
<li><code><cite>DebuggingReport.txt</cite></code>. Your debugging report</li>
</ol>
</td>
<td width=5><br></td></tr></table>
<a name="9709441"></a><table><tr>
<td width=5><br></td> <td valign=top class=td0_x align=left > <a href="#top_9709441">Go to top of question.</a> </td>
<td width=5><br></td></tr></table>
<hr><table><tr>
<td width=5><br></td> <td valign=top class=td0_x align=left ><span class=lbl0-x>File to submit:</span><br> <input type=file class='x' name=file_to_add_9709441 value="" size=20 maxLength=500 > </td>
<td width=5><br></td><td valign=bottom> <input class=x value="Upload File" type=submit name=add_file id=add_file style="width: 12em;" onClick='return SetUploadTime("https://www.icarnegie.com:443/takeassmcmd.php?question_id=9709441", 9709441, false)'></td><td width=5><br></td><td valign=bottom> <input class=x value="Forward File" type=submit name=mail_file id=mail_file style="width: 12em;" onClick='return SetUploadTime("https://bjtu-cqc.icarnegie.com:443/mailuploadcmd.php?question_id=9709441", 9709441, true)'></td><td width=5><br></td><td valign=bottom> <input class=x value="Refresh" onClick="ChangeCommand(document.Assm, 'https://www.icarnegie.com:443/refreshassmtakecmd.php?question_id=9709441')" type=submit onfocus='ResetTarget()'></td><td width=5><br></td><td valign=bottom> <input class=x-font value="Ready for Grading" onClick="ChangeCommand(document.Assm, 'https://www.icarnegie.com:443/takeassmcmd.php?question_id=9709441')" type=submit name=ready_for_grading id=ready_for_grading style="width: 12em;" onfocus='ResetTarget()' disabled></td><td width=5><br></td></tr></table>
<hr><table><tr>
<input type=hidden name="pr_state_9709441" id="pr_state_9709441" value='a:2:{i:0;s:10:"incomplete";i:1;a:0:{}}' ></tr></table>
<table><tr>
<td width=5><br></td> <td valign=top class=td0_x align=left > <a href="#top_of_page">Go to top of assessment.</a> </td>
<input type=hidden name="max_mins_per_try" id="max_mins_per_try" value='120' > <input type=hidden name="end_date" id="end_date" value='2007-10-22 08:07:16 UTC' > <input type=hidden name="course_section_id" id="course_section_id" value='12959222' > <input type=hidden name="assm_id" id="assm_id" value='9709438' > <input type=hidden name="template_id" id="template_id" value='13001846' > <input type=hidden name="record_id" id="record_id" value='13001847' > <input type=hidden name="client_time" id="client_time" value='' ></tr></table>
<table><tr>
<td width=5><br></td> <td valign=top class=td0_copyright align=left > © Copyright 2006 iCarnegie, Inc. All rights reserved. </td>
</tr></table>
</form>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -