⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 takeassmcmd.html

📁 ssd2 exercise3 的题目和答案
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<html>
<head>
<link rel=stylesheet href="/css/cteform.css" type="text/css">
<title>Take Assessment: Exercise 3 &copy; 2002-2006 iCarnegie, Inc. - UI Version 3.18.1</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=10692391" + "&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: Exercise 3</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>
<td width=5><br></td>  <td class=td0_error  align=left valign=top >
     <span class=error >This is a resumption of your previous attempt.<br>Please note: At this time, we cannot track responses you entered previously.</span></td>
  <input type=hidden name="object_id" id="object_id" value='11144926' ></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>
  <input type=hidden name="MAX_FILE_SIZE" id="MAX_FILE_SIZE" value='512000' ><td width=5><br></td></tr></table>
<a name="top_9710101"></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="#9710101">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">Implementing the Gourmet Coffee  System</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> <em>Object Oriented Programming</em>
<ul>
        <li>Knowledge of class design
<ul>
            <li> Class attributes</li>
            <li>Constructors</li>
            <li>Accessor methods</li>
            <li>Mutator methods</li>
          </ul>
        </li>
        <li>Knowledge of inheritance
<ul>
            <li> How to implement a specialization/generalization relationship 
              using inheritance</li>
          </ul>
        </li>
      </ul>
  </ul>
  <p> <b><i>Goals:</i></b> Reinforce your 
    ability to implement Java classes using <em></em>inheritance. 
  <p> <b><i>Outcomes:</i></b> You
    will demonstrate mastery of the following: 
  <ul>
    <li>Implementing the constructors, accessors, and
    mutators of a Java class</li>
    <li>Using inheritance to implement a specialization/generalization relationship</li>
  </ul>
</blockquote>
<h3>Background </h3>

<p>This assignment asks you to implement some of the classes in the <em>Gourmet 
  Coffee System</em> specified on Exercise 2.</p>
<h3>Description</h3>
<p>In this assessment, you will implement the classes and  relationships 
  illustrated in the following class diagram:</p>

<blockquote>
<table cellpadding="2" width="75%" cellspacing="2" border="0">
  <tr>
      <td><img width="467" height="444" src="/content/SSD/SSD3/4.2.0.1/normal/pg-class-imp/pg-impl-class/assm-exer-impl-class/pool-pr-impl-class/qn-pr-impl-class-cof-gou-sys/handout/images/impl-cof-gou-sys.jpg" alt="Figure 1 Portion of Gourmet Coffee System class diagram"></td>
  </tr>
  <tr>
      <td><b>Figure 1 </b><i> Portion of Gourmet Coffee System class
          diagram</i></td>
  </tr>
</table>
</blockquote>

<p>The class specifications are as follows:</p>
<h4>Class <code>Product</code></h4>
<p>The class <code>Product</code> models a generic product in the store.</p>
<p><em>Instance variables:</em></p>
<ul>
  <li><code><em>code</em></code>. The unique code that identifies the product</li>
  <li><code><em>description</em></code>. A short description of the product</li>
  <li><code><em>price</em></code>. The price of the product</li>
</ul>
<p><em>Constructor and methods:</em></p>
<ul>
  <li> 
    <pre><em>public Product(String initialCode,
               String initialDescription,
               double initialPrice)</em></pre>
	<p>Constructor that initializes the instance variables 
    <code>code</code>, <code>description</code>, and <code>price</code>.</p>
  </li>
</ul>
<ul>
  <li> <code><em>public String getCode()</em></code>. Returns the value of instance 
    variable <code>code</code>.</li>
</ul>
<ul>
  <li> <code><em>public String getDescription()</em></code>. Returns the value 
    of instance variable <code>description</code>.</li>
</ul>
<ul>
  <li> <code><em>public double getPrice()</em></code>. Returns the value of instance 
    variable <code>price</code>.</li>
</ul>
<ul>
  <li><code><em>boolean equals(Object object)</em></code>. Overrides the method 
    <code>equals</code> in the class <code>Object</code>. Two <code>Product</code> 
    objects are equal if their codes are equal.</li>
</ul>
<ul>
  <li><code></code><code><em>String toString()</em></code>. Overrides the method 
    <code>toString</code> in the class <code>Object</code>. Returns the string 
    representation of a <code>Product</code> object. The <code>String</code> returned 
    has the following format: 
    <blockquote> 
      <pre><em>code</em><em>_description_price</em><em></em><em></em></pre>
    </blockquote>
    <p>The fields are separated by an underscore ( <code>_</code> ). You can assume 
      that the fields themselves do not contain any underscores.</p>
  </li>
</ul>
<h4>Class <code>Coffee</code></h4>
<p>The class <code>Coffee</code> models a coffee product. It  extends
  class <code>Product</code>.</p>
<p><em>Instance variables:</em></p>
<ul>
  <li><code><em>origin</em></code>. The origin of the coffee<code></code></li>
  <li><code><em>roast</em></code>. The roast of the coffee<code></code></li>
  <li><code><em>flavor</em></code>. The flavor of the coffee<code></code></li>
  <li><em><code>aroma</code></em>. The aroma of the coffee<code></code></li>
  <li><code><em>acidity</em></code>. The acidity of the coffee<code></code></li>
  <li><code><em>body</em></code>. The body of the coffee<code></code></li>
</ul>
<p><em>Constructor and methods:</em></p>
<ul>
  <li> 
    <pre><em>public Coffee(String initialCode,
              String initialDescription,
              double initialPrice,
              String initialOrigin,
              String initialRoast,

⌨️ 快捷键说明

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