Guest User

Untitled

a guest
Nov 5th, 2014
474
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 41.68 KB | None | 0 0
  1.  
  2. <!DOCTYPE html>
  3. <html dir="ltr" lang="en-us" xml:lang="en-us">
  4. <head>
  5. <title>Assignment</title>
  6. <link rel="shortcut icon" href="http://courses.cs.westga.edu/theme/image.php/clean/theme/1410783613/favicon" />
  7. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  8. <meta name="keywords" content="moodle, Assignment" />
  9. <script type="text/javascript">
  10. //<![CDATA[
  11. var M = {}; M.yui = {};
  12. M.pageloadstarttime = new Date();
  13. M.cfg = {"wwwroot":"http:\/\/courses.cs.westga.edu","sesskey":"GbQduG2lyJ","loadingicon":"http:\/\/courses.cs.westga.edu\/theme\/image.php\/clean\/core\/1410783613\/i\/loading_small","themerev":"1410783613","slasharguments":1,"theme":"clean","jsrev":"1410783613","svgicons":true};var yui1ConfigFn = function(me) {if(/-skin|reset|fonts|grids|base/.test(me.name)){me.type='css';me.path=me.path.replace(/\.js/,'.css');me.path=me.path.replace(/\/yui2-skin/,'/assets/skins/sam/yui2-skin')}};
  14. var yui2ConfigFn = function(me) {var parts=me.name.replace(/^moodle-/,'').split('-'),component=parts.shift(),module=parts[0],min='-min';if(/-(skin|core)$/.test(me.name)){parts.pop();me.type='css';min=''};if(module){var filename=parts.join('-');me.path=component+'/'+module+'/'+filename+min+'.'+me.type}else me.path=component+'/'+component+'.'+me.type};
  15. YUI_config = {"debug":false,"base":"http:\/\/courses.cs.westga.edu\/lib\/yuilib\/3.15.0\/","comboBase":"http:\/\/courses.cs.westga.edu\/theme\/yui_combo.php?","combine":true,"filter":null,"insertBefore":"firstthemesheet","groups":{"yui-patched":{"combine":true,"root":"3.15.0_1\/","patterns":{"dd-drag":{"group":"yui-patched"},"dd-gestures":{"group":"yui-patched"}},"modules":{"dd-drag":[],"dd-gestures":[]}},"yui2":{"base":"http:\/\/courses.cs.westga.edu\/lib\/yuilib\/2in3\/2.9.0\/build\/","comboBase":"http:\/\/courses.cs.westga.edu\/theme\/yui_combo.php?","combine":true,"ext":false,"root":"2in3\/2.9.0\/build\/","patterns":{"yui2-":{"group":"yui2","configFn":yui1ConfigFn}}},"moodle":{"name":"moodle","base":"http:\/\/courses.cs.westga.edu\/theme\/yui_combo.php?m\/1410783613\/","combine":true,"comboBase":"http:\/\/courses.cs.westga.edu\/theme\/yui_combo.php?","ext":false,"root":"m\/1410783613\/","patterns":{"moodle-":{"group":"moodle","configFn":yui2ConfigFn}},"filter":null,"modules":{"moodle-core-actionmenu":{"requires":["base","event","node-event-simulate"]},"moodle-core-blocks":{"requires":["base","node","io","dom","dd","dd-scroll","moodle-core-dragdrop","moodle-core-notification"]},"moodle-core-chooserdialogue":{"requires":["base","panel","moodle-core-notification"]},"moodle-core-dock":{"requires":["base","node","event-custom","event-mouseenter","event-resize","escape","moodle-core-dock-loader"]},"moodle-core-dock-loader":{"requires":["escape"]},"moodle-core-formautosubmit":{"requires":["base","event-key"]},"moodle-core-formchangechecker":{"requires":["base","event-focus"]},"moodle-core-lockscroll":{"requires":["plugin","base-build"]},"moodle-core-notification":{"requires":["moodle-core-notification-dialogue","moodle-core-notification-alert","moodle-core-notification-confirm","moodle-core-notification-exception","moodle-core-notification-ajaxexception"]},"moodle-core-notification-dialogue":{"requires":["base","node","panel","escape","event-key","dd-plugin","moodle-core-widget-focusafterclose","moodle-core-lockscroll"]},"moodle-core-notification-alert":{"requires":["moodle-core-notification-dialogue"]},"moodle-core-notification-confirm":{"requires":["moodle-core-notification-dialogue"]},"moodle-core-notification-exception":{"requires":["moodle-core-notification-dialogue"]},"moodle-core-notification-ajaxexception":{"requires":["moodle-core-notification-dialogue"]},"moodle-core-popuphelp":{"requires":["moodle-core-tooltip"]},"moodle-core-tooltip":{"requires":["base","node","io-base","moodle-core-notification-dialogue","json-parse","widget-position","widget-position-align","event-outside","cache-base"]},"moodle-core-checknet":{"requires":["base-base","moodle-core-notification-alert","io-base"]},"moodle-core-dragdrop":{"requires":["base","node","io","dom","dd","event-key","event-focus","moodle-core-notification"]},"moodle-core-event":{"requires":["event-custom"]},"moodle-core-handlebars":{"condition":{"trigger":"handlebars","when":"after"}},"moodle-core-maintenancemodetimer":{"requires":["base","node"]},"moodle-core_availability-form":{"requires":["base","node","event","panel","moodle-core-notification-dialogue","json"]},"moodle-backup-backupselectall":{"requires":["node","event","node-event-simulate","anim"]},"moodle-backup-confirmcancel":{"requires":["node","node-event-simulate","moodle-core-notification-confirm"]},"moodle-calendar-eventmanager":{"requires":["base","node","event-mouseenter","overlay","moodle-calendar-eventmanager-skin"]},"moodle-course-categoryexpander":{"requires":["node","event-key"]},"moodle-course-management":{"requires":["base","node","io-base","moodle-core-notification-exception","json-parse","dd-constrain","dd-proxy","dd-drop","dd-delegate","node-event-delegate"]},"moodle-course-util":{"requires":["node"],"use":["moodle-course-util-base"],"submodules":{"moodle-course-util-base":{},"moodle-course-util-section":{"requires":["node","moodle-course-util-base"]},"moodle-course-util-cm":{"requires":["node","moodle-course-util-base"]}}},"moodle-course-dragdrop":{"requires":["base","node","io","dom","dd","dd-scroll","moodle-core-dragdrop","moodle-core-notification","moodle-course-coursebase","moodle-course-util"]},"moodle-course-formatchooser":{"requires":["base","node","node-event-simulate"]},"moodle-course-modchooser":{"requires":["moodle-core-chooserdialogue","moodle-course-coursebase"]},"moodle-course-toolboxes":{"requires":["node","base","event-key","node","io","moodle-course-coursebase","moodle-course-util"]},"moodle-form-passwordunmask":{"requires":["node","base"]},"moodle-form-shortforms":{"requires":["node","base","selector-css3"]},"moodle-form-showadvanced":{"requires":["node","base","selector-css3"]},"moodle-question-chooser":{"requires":["moodle-core-chooserdialogue"]},"moodle-question-preview":{"requires":["base","dom","event-delegate","event-key","core_question_engine"]},"moodle-question-qbankmanager":{"requires":["node","selector-css3"]},"moodle-question-searchform":{"requires":["base","node"]},"moodle-availability_completion-form":{"requires":["base","node","event","moodle-core_availability-form"]},"moodle-availability_date-form":{"requires":["base","node","event","io","moodle-core_availability-form"]},"moodle-availability_grade-form":{"requires":["base","node","event","moodle-core_availability-form"]},"moodle-availability_group-form":{"requires":["base","node","event","moodle-core_availability-form"]},"moodle-availability_grouping-form":{"requires":["base","node","event","moodle-core_availability-form"]},"moodle-availability_profile-form":{"requires":["base","node","event","moodle-core_availability-form"]},"moodle-mod_assign-history":{"requires":["node","transition"]},"moodle-mod_quiz-autosave":{"requires":["base","node","event","event-valuechange","node-event-delegate","io-form"]},"moodle-message_airnotifier-toolboxes":{"requires":["base","node","io"]},"moodle-block_navigation-navigation":{"requires":["base","io-base","node","event-synthetic","event-delegate","json-parse"]},"moodle-filter_glossary-autolinker":{"requires":["base","node","io-base","json-parse","event-delegate","overlay","moodle-core-event","moodle-core-notification-alert"]},"moodle-filter_mathjaxloader-loader":{"requires":["moodle-core-event"]},"moodle-editor_atto-editor":{"requires":["node","io","overlay","escape","event","event-simulate","event-custom","yui-throttle","moodle-core-notification-dialogue","moodle-editor_atto-rangy","handlebars","timers"]},"moodle-editor_atto-plugin":{"requires":["node","base","escape","event","event-outside","handlebars","event-custom","timers"]},"moodle-editor_atto-menu":{"requires":["moodle-core-notification-dialogue","node","event","event-custom"]},"moodle-editor_atto-rangy":{"requires":[]},"moodle-report_eventlist-eventfilter":{"requires":["base","event","node","node-event-delegate","datatable","autocomplete","autocomplete-filters"]},"moodle-report_loglive-fetchlogs":{"requires":["base","event","node","io","node-event-delegate"]},"moodle-gradereport_grader-scrollview":{"requires":["base","node"]},"moodle-tool_capability-search":{"requires":["base","node"]},"moodle-theme_bootstrapbase-bootstrap":{"requires":["node","selector-css3"]},"moodle-assignfeedback_editpdf-editor":{"requires":["base","event","node","io","graphics","json","event-move","querystring-stringify-simple","moodle-core-notification-dialog","moodle-core-notification-exception","moodle-core-notification-ajaxexception"]},"moodle-atto_accessibilitychecker-button":{"requires":["color-base","moodle-editor_atto-plugin"]},"moodle-atto_accessibilityhelper-button":{"requires":["moodle-editor_atto-plugin"]},"moodle-atto_align-button":{"requires":["moodle-editor_atto-plugin"]},"moodle-atto_bold-button":{"requires":["moodle-editor_atto-plugin"]},"moodle-atto_charmap-button":{"requires":["moodle-editor_atto-plugin"]},"moodle-atto_clear-button":{"requires":["moodle-editor_atto-plugin"]},"moodle-atto_collapse-button":{"requires":["moodle-editor_atto-plugin"]},"moodle-atto_emoticon-button":{"requires":["moodle-editor_atto-plugin"]},"moodle-atto_equation-button":{"requires":["moodle-editor_atto-plugin","moodle-core-event","io","event-valuechange","tabview","array-extras"]},"moodle-atto_html-button":{"requires":["moodle-editor_atto-plugin","event-valuechange"]},"moodle-atto_image-button":{"requires":["moodle-editor_atto-plugin"]},"moodle-atto_indent-button":{"requires":["moodle-editor_atto-plugin"]},"moodle-atto_italic-button":{"requires":["moodle-editor_atto-plugin"]},"moodle-atto_link-button":{"requires":["moodle-editor_atto-plugin"]},"moodle-atto_managefiles-button":{"requires":["moodle-editor_atto-plugin"]},"moodle-atto_managefiles-usedfiles":{"requires":["node","escape"]},"moodle-atto_media-button":{"requires":["moodle-editor_atto-plugin"]},"moodle-atto_noautolink-button":{"requires":["moodle-editor_atto-plugin"]},"moodle-atto_orderedlist-button":{"requires":["moodle-editor_atto-plugin"]},"moodle-atto_rtl-button":{"requires":["moodle-editor_atto-plugin"]},"moodle-atto_strike-button":{"requires":["moodle-editor_atto-plugin"]},"moodle-atto_subscript-button":{"requires":["moodle-editor_atto-plugin"]},"moodle-atto_superscript-button":{"requires":["moodle-editor_atto-plugin"]},"moodle-atto_table-button":{"requires":["moodle-editor_atto-plugin","moodle-editor_atto-menu","event","event-valuechange"]},"moodle-atto_title-button":{"requires":["moodle-editor_atto-plugin"]},"moodle-atto_underline-button":{"requires":["moodle-editor_atto-plugin"]},"moodle-atto_undo-button":{"requires":["moodle-editor_atto-plugin"]},"moodle-atto_unorderedlist-button":{"requires":["moodle-editor_atto-plugin"]}}},"gallery":{"name":"gallery","base":"http:\/\/courses.cs.westga.edu\/lib\/yuilib\/gallery\/","combine":true,"comboBase":"http:\/\/courses.cs.westga.edu\/theme\/yui_combo.php?","ext":false,"root":"gallery\/1410783613\/","patterns":{"gallery-":{"group":"gallery"}}}},"modules":{"core_filepicker":{"name":"core_filepicker","fullpath":"http:\/\/courses.cs.westga.edu\/lib\/javascript.php\/1410783613\/repository\/filepicker.js","requires":["base","node","node-event-simulate","json","async-queue","io-base","io-upload-iframe","io-form","yui2-treeview","panel","cookie","datatable","datatable-sort","resize-plugin","dd-plugin","escape","moodle-core_filepicker"]},"mathjax":{"name":"mathjax","fullpath":"http:\/\/cdn.mathjax.org\/mathjax\/latest\/MathJax.js?delayStartupUntil=configured"}}};
  16. M.yui.loader = {modules: {}};
  17.  
  18. //]]>
  19. </script>
  20. <link rel="stylesheet" type="text/css" href="http://courses.cs.westga.edu/theme/yui_combo.php?rollup/3.15.0/yui-moodlesimple-min.css" /><script type="text/javascript" src="http://courses.cs.westga.edu/theme/yui_combo.php?rollup/3.15.0_1/yui-moodlesimple-min.js&amp;rollup/1410783613/mcore-min.js"></script><script id="firstthemesheet" type="text/css">/** Required in order to fix style inclusion problems in IE with YUI **/</script><link rel="stylesheet" type="text/css" href="http://courses.cs.westga.edu/theme/styles.php/clean/1410783613/all" />
  21. <script type="text/javascript" src="http://courses.cs.westga.edu/lib/javascript.php/1410783613/lib/javascript-static.js"></script>
  22. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  23. </head>
  24.  
  25. <body id="page-mod-assign-view" class="format-weeks path-mod path-mod-assign safari dir-ltr lang-en_us yui-skin-sam yui3-skin-sam courses-cs-westga-edu pagelayout-incourse course-517 context-58443 cmid-54773 category-50 has-region-side-pre used-region-side-pre has-region-side-post empty-region-side-post">
  26.  
  27. <div class="skiplinks"><a class="skip" href="#maincontent">Skip to main content</a></div>
  28. <script type="text/javascript">
  29. //<![CDATA[
  30. document.body.className += ' jsenabled';
  31. //]]>
  32. </script>
  33.  
  34.  
  35. <header role="banner" class="navbar navbar-fixed-top moodle-has-zindex">
  36. <nav role="navigation" class="navbar-inner">
  37. <div class="container-fluid">
  38. <a class="brand" href="http://courses.cs.westga.edu">Courses@CS</a>
  39. <a class="btn btn-navbar" data-toggle="workaround-collapse" data-target=".nav-collapse">
  40. <span class="icon-bar"></span>
  41. <span class="icon-bar"></span>
  42. <span class="icon-bar"></span>
  43. </a>
  44. <div class="nav-collapse collapse">
  45. <ul class="nav"><li><a title="Computer Science Department" href="http://www.cs.westga.edu">Computer Science Department</a><li><a title="csX Tutoring Lab" href="http://cs.westga.edu/csx">csX Tutoring Lab</a><li><a title="Faculty Office Hours" href="http://courses.cs.westga.edu/local/officehours.php">Faculty Office Hours</a><li><a title="Course Archives" href="http://courses.cs.westga.edu/course/category.php?id=12">Course Archives</a></ul> <ul class="nav pull-right">
  46. <li></li>
  47. <li class="navbar-text"><div class="logininfo">You are logged in as <a href="http://courses.cs.westga.edu/user/profile.php?id=4367" title="View profile">Matthew Lister</a> (<a href="http://courses.cs.westga.edu/login/logout.php?sesskey=GbQduG2lyJ">Log out</a>)</div></li>
  48. </ul>
  49. </div>
  50. </div>
  51. </nav>
  52. </header>
  53.  
  54. <div id="page" class="container-fluid">
  55.  
  56. <header id="page-header" class="clearfix">
  57. <h1>CS1301: Computer Science I (Section 3) [F14]</h1> <div id="page-navbar" class="clearfix">
  58. <nav class="breadcrumb-nav"><span class="accesshide">Page path</span><ul class="breadcrumb"><li><a href="http://courses.cs.westga.edu/">Home</a> <span class="divider"> <span class="accesshide " ><span class="arrow_text">/</span>&nbsp;</span><span class="arrow sep">&#x25BA;</span> </span></li><li><a href="http://courses.cs.westga.edu/my/">My courses</a> <span class="divider"> <span class="accesshide " ><span class="arrow_text">/</span>&nbsp;</span><span class="arrow sep">&#x25BA;</span> </span></li><li><a href="http://courses.cs.westga.edu/course/index.php?categoryid=50">Fall 2014</a> <span class="divider"> <span class="accesshide " ><span class="arrow_text">/</span>&nbsp;</span><span class="arrow sep">&#x25BA;</span> </span></li><li><a title="CS1301: Computer Science I (Section 3) [F14]" href="http://courses.cs.westga.edu/course/view.php?id=517">CS1301.03 [F14]</a> <span class="divider"> <span class="accesshide " ><span class="arrow_text">/</span>&nbsp;</span><span class="arrow sep">&#x25BA;</span> </span></li><li><span tabindex="0">November 3 - November 9</span> <span class="divider"> <span class="accesshide " ><span class="arrow_text">/</span>&nbsp;</span><span class="arrow sep">&#x25BA;</span> </span></li><li><a title="Assignment" href="http://courses.cs.westga.edu/mod/assign/view.php?id=54773">[Studio] Arrays and ArrayLists</a></li></ul></nav>
  59. <div class="breadcrumb-button"></div>
  60. </div>
  61. <div id="course-header">
  62. </div>
  63. </header>
  64.  
  65. <div id="page-content" class="row-fluid">
  66. <div id="region-bs-main-and-pre" class="span9">
  67. <div class="row-fluid">
  68. <section id="region-main" class="span8 pull-right">
  69. <div role="main"><span id="maincontent"></span><h2>[Studio] Arrays and ArrayLists</h2><div id="intro" class="box generalbox boxaligncenter"><div class="no-overflow"><h1>Overview</h1>
  70. <p>In this studio you will practice working with arrays and <span style="font-family: 'courier new', courier, monospace;">ArrayLists</span>, as well as reviewing the basics of writing classes and unit tests.</p>
  71. <h1>Setup</h1>
  72. <p>Begin by opening <a href="http://courses.cs.westga.edu/pluginfile.php/58443/mod_assign/intro/ArraysAndArrayListsStudio.zip">this project</a> in Eclipse.</p>
  73. <h1>Feature #1: Null parameter check for the <span style="font-family: 'courier new', courier, monospace;">BoxArray</span> constructor</h1>
  74. <p>Open the <span style="font-family: 'courier new', courier, monospace;">BoxArray</span> class and find its constructor. Note that it takes as a parameter an array of <span style="font-family: 'courier new', courier, monospace;">Rectangle</span> objects. Write a parameter check that checks if the <span style="font-family: 'courier new', courier, monospace;">boxes</span> array is <span style="font-family: 'courier new', courier, monospace;">null </span>and throws an <span style="font-family: 'courier new', courier, monospace;">IllegalArgumentException</span> if it is.</p>
  75. <h2>Testing</h2>
  76. <p>Run the JUnit test class <span style="font-family: 'courier new', courier, monospace;">WhenSummingPerimeters</span>. It already contains a unit test to for the case where the boxes array is null. If the test passes, you are done with this feature. If the test does not pass, go back and correct your code.</p>
  77. <h1>Feature #2: Completing the <span style="font-family: 'courier new', courier, monospace;">BoxArray</span> constructor</h1>
  78. <p>Complete the <span style="font-family: 'courier new', courier, monospace;">BoxArray</span> constructor by:</p>
  79. <ul>
  80. <li>adding a parameter check that checks if <span style="font-family: 'courier new', courier, monospace;">boxes</span> is a zero-length array, throwing <span style="font-family: 'courier new', courier, monospace;">IllegalArgumentException</span> if it is</li>
  81. <li>properly initializing the <span style="font-family: 'courier new', courier, monospace;">boxes</span> instance variable</li>
  82. </ul>
  83. <h2>Testing</h2>
  84. <p>In <span style="font-family: 'courier new', courier, monospace;">WhenSummingPerimeters</span>, write and run a JUnit test that tests the case where a <span style="font-family: 'courier new', courier, monospace;">BoxArray</span> is constructed with a zero-length array.</p>
  85. <h1>Feature #3: Getting the sum of all perimeters</h1>
  86. <p>In the <span style="font-family: 'courier new', courier, monospace;">BoxArray</span> class, write a method <span style="font-family: 'courier new', courier, monospace;">getSumOfPerimeters()</span> that:</p>
  87. <ul>
  88. <li>uses a for-each loop over the elements of <span style="font-family: 'courier new', courier, monospace;">this.boxes</span> to:
  89. <ul>
  90. <li>find the perimeter of the current box</li>
  91. <li>add that perimeter to a running sum</li>
  92. </ul>
  93. </li>
  94. <li>returns the sum (as an <span style="font-family: 'courier new', courier, monospace;">int</span>)</li>
  95. </ul>
  96. <h2>Testing</h2>
  97. <p>In <span style="font-family: 'courier new', courier, monospace;">WhenSummingPerimeters</span>, write and run JUnit tests that handle the following cases:</p>
  98. <ul>
  99. <li>when the <span style="font-family: 'courier new', courier, monospace;">BoxArray</span> contains a single <span style="font-family: 'courier new', courier, monospace;">Rectangle</span></li>
  100. <li>when the <span style="font-family: 'courier new', courier, monospace;">BoxArray</span> contains six <span style="font-family: 'courier new', courier, monospace;">Rectangles</span></li>
  101. </ul>
  102. <p>For each test, you will need to do the following:</p>
  103. <ol>
  104. <li>create an array of <span style="font-family: 'courier new', courier, monospace;">Rectangles</span> of the appropriate size (either 1 or 6)</li>
  105. <li>assign a new <span style="font-family: 'courier new', courier, monospace;">Rectangle</span> object to each element of the array</li>
  106. <li>create a new <span style="font-family: 'courier new', courier, monospace;">BoxArray</span> object, passing the array to its constructor</li>
  107. <li>test the<span style="font-family: 'courier new', courier, monospace;"> getSumOfPerimeters()</span> method using an <span style="font-family: 'courier new', courier, monospace;">assertEquals()</span></li>
  108. </ol>
  109. <h1><span style="font-family: arial, helvetica, sans-serif;">Feature #4: The <span style="font-family: 'courier new', courier, monospace;">BoxList</span> class and constructor</span></h1>
  110. <p>Write a <span style="font-family: 'courier new', courier, monospace;">BoxList</span> class that:</p>
  111. <ul>
  112. <li>has an instance variable, named <span style="font-family: 'courier new', courier, monospace;">boxes</span>, that is an <span style="font-family: 'courier new', courier, monospace;">ArrayList</span> of <span style="font-family: 'courier new', courier, monospace;">Rectangle</span> objects.</li>
  113. <li>has a constructor that
  114. <ul>
  115. <li>takes a single parameter: an <span style="font-family: 'courier new', courier, monospace;">ArrayList</span> of <span style="font-family: 'courier new', courier, monospace;">Rectangle</span> objects. It should be named <span style="font-family: 'courier new', courier, monospace;">boxes</span>.</li>
  116. <li>performs a parameter check to make sure that <span style="font-family: 'courier new', courier, monospace;">boxes</span> is not <span style="font-family: 'courier new', courier, monospace;">null</span></li>
  117. <li>initializes the <span style="font-family: 'courier new', courier, monospace;">boxes</span> instance variable</li>
  118. </ul>
  119. </li>
  120. </ul>
  121. <h2>Testing</h2>
  122. <p>Write and run a <span style="font-family: 'courier new', courier, monospace;">WhenAveragingAreas</span> JUnit test class for testing your <span style="font-family: 'courier new', courier, monospace;">BoxList</span> class. It should have a test method for the case where we try to create a <span style="font-family: 'courier new', courier, monospace;">BoxList</span> using a <span style="font-family: 'courier new', courier, monospace;">null ArrayList parameter</span>.</p>
  123. <h1>Feature #5: Getting the average of all box areas</h1>
  124. <p>In <span style="font-family: 'courier new', courier, monospace;">BoxList</span>, write a <span style="font-family: 'courier new', courier, monospace;">getAverageArea()</span> method that finds the average of the areas of the <span style="font-family: 'courier new', courier, monospace;">Rectangles</span> in the <span style="font-family: 'courier new', courier, monospace;">BoxList</span>.</p>
  125. <h2>Testing</h2>
  126. <p>In <span style="font-family: 'courier new', courier, monospace;">WhenAveragingAreas</span>, write and run test methods for the following test cases:</p>
  127. <ul>
  128. <li>when the list has zero <span style="font-family: 'courier new', courier, monospace;">Rectangles</span> in it (should return an average of zero).</li>
  129. <li>when the list has one <span style="font-family: 'courier new', courier, monospace;">Rectangle</span> in it</li>
  130. <li>when the list has six <span style="font-family: 'courier new', courier, monospace;">Rectangles</span> in it</li>
  131. </ul>
  132. <h1>Turn-in</h1>
  133. <p>When you are finished, export your project and turn it in below.</p>
  134. <p></p>
  135. <p></p>
  136. <p></p></div></div><div class="submissionstatustable"><h3>Submission status</h3><div class="box boxaligncenter submissionsummarytable"><table class="generaltable">
  137. <tbody><tr class="r0">
  138. <td class="cell c0" style="">Submission status</td>
  139. <td class="cell c1 lastcol" style="">No attempt</td>
  140. </tr>
  141. <tr class="r1">
  142. <td class="cell c0" style="">Grading status</td>
  143. <td class="submissionnotgraded cell c1 lastcol" style="">Not graded</td>
  144. </tr>
  145. <tr class="r0">
  146. <td class="cell c0" style="">Due date</td>
  147. <td class="cell c1 lastcol" style="">Monday, November 10, 2014, 11:00 PM</td>
  148. </tr>
  149. <tr class="r1 lastrow">
  150. <td class="cell c0" style="">Time remaining</td>
  151. <td class="cell c1 lastcol" style="">5 days 9 hours</td>
  152. </tr>
  153. </tbody>
  154. </table>
  155. </div><div class="box generalbox submissionaction"><div class="singlebutton"><form method="get" action="http://courses.cs.westga.edu/mod/assign/view.php"><div><input type="submit" value="Add submission" /><input type="hidden" name="id" value="54773" /><input type="hidden" name="action" value="editsubmission" /></div></form></div><div class="box boxaligncenter submithelp">Make changes to your submission</div></div></div></div> </section>
  156. <aside id="block-region-side-pre" class="span4 desktop-first-column block-region" data-blockregion="side-pre" data-droptarget="1"><a href="#sb-1" class="skip-block">Skip Navigation</a><div id="inst3658" class="block_navigation block" role="navigation" data-block="navigation" data-instanceid="3658" aria-labelledby="instance-3658-header" data-dockable="1"><div class="header"><div class="title"><div class="block_action"></div><h2 id="instance-3658-header">Navigation</h2></div></div><div class="content"><ul class="block_tree list"><li class="type_unknown depth_1 contains_branch" aria-expanded="true"><p class="tree_item branch canexpand navigation_node"><a href="http://courses.cs.westga.edu/">Home</a></p><ul><li class="type_setting depth_2 item_with_icon"><p class="tree_item leaf hasicon"><a href="http://courses.cs.westga.edu/my/"><img alt="" class="smallicon navicon" title="" src="http://courses.cs.westga.edu/theme/image.php/clean/core/1410783613/i/navigationitem" />My home</a></p></li>
  157. <li class="type_course depth_2 collapsed contains_branch" aria-expanded="false"><p class="tree_item branch"><span title="Computer Science Course Web" tabindex="0">Site pages</span></p><ul><li class="type_custom depth_3 item_with_icon"><p class="tree_item leaf hasicon"><a href="http://courses.cs.westga.edu/badges/view.php?type=1"><img alt="" class="smallicon navicon" title="" src="http://courses.cs.westga.edu/theme/image.php/clean/core/1410783613/i/navigationitem" />Site badges</a></p></li>
  158. <li class="type_custom depth_3 item_with_icon"><p class="tree_item leaf hasicon"><a href="http://courses.cs.westga.edu/tag/search.php"><img alt="" class="smallicon navicon" title="" src="http://courses.cs.westga.edu/theme/image.php/clean/core/1410783613/i/navigationitem" />Tags</a></p></li>
  159. <li class="type_custom depth_3 item_with_icon"><p class="tree_item leaf hasicon"><a href="http://courses.cs.westga.edu/calendar/view.php?view=month"><img alt="" class="smallicon navicon" title="" src="http://courses.cs.westga.edu/theme/image.php/clean/core/1410783613/i/navigationitem" />Calendar</a></p></li></ul></li>
  160. <li class="type_user depth_2 collapsed contains_branch" aria-expanded="false"><p class="tree_item branch"><span tabindex="0">My profile</span></p><ul><li class="type_custom depth_3 item_with_icon"><p class="tree_item leaf hasicon"><a href="http://courses.cs.westga.edu/user/profile.php?id=4367"><img alt="" class="smallicon navicon" title="" src="http://courses.cs.westga.edu/theme/image.php/clean/core/1410783613/i/navigationitem" />View profile</a></p></li>
  161. <li class="type_custom depth_3 collapsed contains_branch" aria-expanded="false"><p class="tree_item branch"><span tabindex="0">Forum posts</span></p><ul><li class="type_custom depth_4 item_with_icon"><p class="tree_item leaf hasicon"><a href="http://courses.cs.westga.edu/mod/forum/user.php?id=4367"><img alt="" class="smallicon navicon" title="" src="http://courses.cs.westga.edu/theme/image.php/clean/core/1410783613/i/navigationitem" />Posts</a></p></li>
  162. <li class="type_custom depth_4 item_with_icon"><p class="tree_item leaf hasicon"><a href="http://courses.cs.westga.edu/mod/forum/user.php?id=4367&amp;mode=discussions"><img alt="" class="smallicon navicon" title="" src="http://courses.cs.westga.edu/theme/image.php/clean/core/1410783613/i/navigationitem" />Discussions</a></p></li></ul></li>
  163. <li class="type_setting depth_3 item_with_icon"><p class="tree_item leaf hasicon"><a href="http://courses.cs.westga.edu/user/files.php"><img alt="" class="smallicon navicon" title="" src="http://courses.cs.westga.edu/theme/image.php/clean/core/1410783613/i/navigationitem" />My private files</a></p></li>
  164. <li class="type_setting depth_3 item_with_icon"><p class="tree_item leaf hasicon"><a href="http://courses.cs.westga.edu/badges/mybadges.php"><img alt="" class="smallicon navicon" title="" src="http://courses.cs.westga.edu/theme/image.php/clean/core/1410783613/i/navigationitem" />My badges</a></p></li>
  165. <li class="type_custom depth_3 item_with_icon"><p class="tree_item leaf hasicon"><a href="http://courses.cs.westga.edu/repository/manage_instances.php?contextid=56136"><img alt="" class="smallicon navicon" title="" src="http://courses.cs.westga.edu/theme/image.php/clean/core/1410783613/i/navigationitem" />Repositories</a></p></li></ul></li>
  166. <li class="type_system depth_2 contains_branch" aria-expanded="true"><p class="tree_item branch"><span tabindex="0">Current course</span></p><ul><li class="type_course depth_3 contains_branch" aria-expanded="true"><p class="tree_item branch canexpand"><a title="CS1301: Computer Science I (Section 3) [F14]" href="http://courses.cs.westga.edu/course/view.php?id=517">CS1301.03 [F14]</a></p><ul><li class="type_unknown depth_4 collapsed contains_branch" aria-expanded="false"><p class="tree_item branch"><a href="http://courses.cs.westga.edu/user/index.php?id=517">Participants</a></p><ul><li class="type_user depth_5 collapsed contains_branch" aria-expanded="false"><p class="tree_item branch"><a href="http://courses.cs.westga.edu/user/view.php?id=4367&amp;course=517">Matthew Lister</a></p><ul><li class="type_custom depth_6 item_with_icon"><p class="tree_item leaf hasicon"><a href="http://courses.cs.westga.edu/user/view.php?id=4367&amp;course=517"><img alt="" class="smallicon navicon" title="" src="http://courses.cs.westga.edu/theme/image.php/clean/core/1410783613/i/navigationitem" />View profile</a></p></li>
  167. <li class="type_custom depth_6 collapsed contains_branch" aria-expanded="false"><p class="tree_item branch"><span tabindex="0">Forum posts</span></p><ul><li class="type_custom depth_7 item_with_icon"><p class="tree_item leaf hasicon"><a href="http://courses.cs.westga.edu/mod/forum/user.php?id=4367&amp;course=517"><img alt="" class="smallicon navicon" title="" src="http://courses.cs.westga.edu/theme/image.php/clean/core/1410783613/i/navigationitem" />Posts</a></p></li>
  168. <li class="type_custom depth_7 item_with_icon"><p class="tree_item leaf hasicon"><a href="http://courses.cs.westga.edu/mod/forum/user.php?id=4367&amp;course=517&amp;mode=discussions"><img alt="" class="smallicon navicon" title="" src="http://courses.cs.westga.edu/theme/image.php/clean/core/1410783613/i/navigationitem" />Discussions</a></p></li></ul></li>
  169. <li class="type_setting depth_6 item_with_icon"><p class="tree_item leaf hasicon"><a href="http://courses.cs.westga.edu/user/files.php"><img alt="" class="smallicon navicon" title="" src="http://courses.cs.westga.edu/theme/image.php/clean/core/1410783613/i/navigationitem" />My private files</a></p></li>
  170. <li class="type_setting depth_6 item_with_icon"><p class="tree_item leaf hasicon"><a href="http://courses.cs.westga.edu/badges/mybadges.php"><img alt="" class="smallicon navicon" title="" src="http://courses.cs.westga.edu/theme/image.php/clean/core/1410783613/i/navigationitem" />My badges</a></p></li>
  171. <li class="type_custom depth_6 item_with_icon"><p class="tree_item leaf hasicon"><a href="http://courses.cs.westga.edu/repository/manage_instances.php?contextid=56136"><img alt="" class="smallicon navicon" title="" src="http://courses.cs.westga.edu/theme/image.php/clean/core/1410783613/i/navigationitem" />Repositories</a></p></li></ul></li></ul></li>
  172. <li class="type_unknown depth_4 collapsed contains_branch" aria-expanded="false"><p class="tree_item branch"><span tabindex="0">Badges</span></p><ul><li class="type_setting depth_5 item_with_icon"><p class="tree_item leaf hasicon"><a href="http://courses.cs.westga.edu/badges/view.php?type=2&amp;id=517"><img alt="Course badges" class="smallicon navicon" title="Course badges" src="http://courses.cs.westga.edu/theme/image.php/clean/core/1410783613/i/badge" />Course badges</a></p></li></ul></li>
  173. <li class="type_structure depth_4 contains_branch" aria-expanded="true"><p class="tree_item branch"><span tabindex="0">November 3 - November 9</span></p><ul><li class="type_activity depth_5 item_with_icon current_branch"><p class="tree_item leaf hasicon active_tree_node"><a title="Assignment" href="http://courses.cs.westga.edu/mod/assign/view.php?id=54773"><img alt="Assignment" class="smallicon navicon" title="Assignment" src="http://courses.cs.westga.edu/theme/image.php/clean/assign/1410783613/icon" />[Studio] Arrays and ArrayLists</a></p></li></ul></li></ul></li></ul></li>
  174. <li class="type_system depth_2 collapsed contains_branch" aria-expanded="false"><p class="tree_item branch" id="expandable_branch_0_mycourses"><a href="http://courses.cs.westga.edu/my/">My courses</a></p></li>
  175. <li class="type_system depth_2 collapsed contains_branch" aria-expanded="false"><p class="tree_item branch" id="expandable_branch_0_courses"><a href="http://courses.cs.westga.edu/course/index.php">Courses</a></p></li></ul></li></ul></div></div><span id="sb-1" class="skip-block-to"></span><a href="#sb-2" class="skip-block">Skip Administration</a><div id="inst3659" class="block_settings block" role="navigation" data-block="settings" data-instanceid="3659" aria-labelledby="instance-3659-header" data-dockable="1"><div class="header"><div class="title"><div class="block_action"></div><h2 id="instance-3659-header">Administration</h2></div></div><div class="content"><div id="settingsnav" class="box block_tree_box"><ul class="block_tree list"><li class="type_course collapsed contains_branch" aria-expanded="false"><p class="tree_item branch root_node"><span tabindex="0">Course administration</span></p><ul><li class="type_setting collapsed item_with_icon"><p class="tree_item leaf"><a href="http://courses.cs.westga.edu/grade/report/index.php?id=517"><img alt="" class="smallicon navicon" title="" src="http://courses.cs.westga.edu/theme/image.php/clean/core/1410783613/i/grades" />Grades</a></p></li></ul></li>
  176. <li class="type_unknown collapsed contains_branch" aria-expanded="false"><hr /><p class="tree_item branch root_node" id="usersettings"><span tabindex="0">My profile settings</span></p><ul><li class="type_setting collapsed item_with_icon"><p class="tree_item leaf"><a href="http://courses.cs.westga.edu/user/edit.php?id=4367&amp;course=517"><img alt="" class="smallicon navicon" title="" src="http://courses.cs.westga.edu/theme/image.php/clean/core/1410783613/i/navigationitem" />Edit profile</a></p></li>
  177. <li class="type_setting collapsed item_with_icon"><p class="tree_item leaf"><a href="http://courses.cs.westga.edu/login/change_password.php?id=517"><img alt="" class="smallicon navicon" title="" src="http://courses.cs.westga.edu/theme/image.php/clean/core/1410783613/i/navigationitem" />Change password</a></p></li>
  178. <li class="type_setting collapsed item_with_icon"><p class="tree_item leaf"><a href="http://courses.cs.westga.edu/user/managetoken.php?sesskey=GbQduG2lyJ"><img alt="" class="smallicon navicon" title="" src="http://courses.cs.westga.edu/theme/image.php/clean/core/1410783613/i/navigationitem" />Security keys</a></p></li>
  179. <li class="type_setting collapsed item_with_icon"><p class="tree_item leaf"><a href="http://courses.cs.westga.edu/message/edit.php?id=4367"><img alt="" class="smallicon navicon" title="" src="http://courses.cs.westga.edu/theme/image.php/clean/core/1410783613/i/navigationitem" />Messaging</a></p></li>
  180. <li class="type_unknown collapsed contains_branch" aria-expanded="false"><p class="tree_item branch"><span tabindex="0">Badges</span></p><ul><li class="type_setting collapsed item_with_icon"><p class="tree_item leaf"><a href="http://courses.cs.westga.edu/badges/preferences.php"><img alt="" class="smallicon navicon" title="" src="http://courses.cs.westga.edu/theme/image.php/clean/core/1410783613/i/navigationitem" />Preferences</a></p></li>
  181. <li class="type_setting collapsed item_with_icon"><p class="tree_item leaf"><a href="http://courses.cs.westga.edu/badges/mybackpack.php"><img alt="" class="smallicon navicon" title="" src="http://courses.cs.westga.edu/theme/image.php/clean/core/1410783613/i/navigationitem" />Backpack settings</a></p></li></ul></li></ul></li></ul></div></div></div><span id="sb-2" class="skip-block-to"></span></aside> </div>
  182. </div>
  183. <aside id="block-region-side-post" class="span3 block-region" data-blockregion="side-post" data-droptarget="1"></aside> </div>
  184.  
  185. <footer id="page-footer">
  186. <div id="course-footer"></div>
  187. <p class="helplink"></p>
  188. <div class="footnote text-center"><div class="text_to_html"><p style="text-align:center;"><a href="http://www.cs.westga.edu">Department of Computer Science</a> • <a href="http://www.westga.edu">University of West Georgia</a></p></div></div><div class="logininfo">You are logged in as <a href="http://courses.cs.westga.edu/user/profile.php?id=4367" title="View profile">Matthew Lister</a> (<a href="http://courses.cs.westga.edu/login/logout.php?sesskey=GbQduG2lyJ">Log out</a>)</div><div class="homelink"><a href="http://courses.cs.westga.edu/course/view.php?id=517">CS1301.03 [F14]</a></div> </footer>
  189.  
  190. <script type="text/javascript" src="http://courses.cs.westga.edu/theme/javascript.php/clean/1410783613/footer"></script>
  191. <script type="text/javascript">
  192. //<![CDATA[
  193. M.str = {"moodle":{"lastmodified":"Last modified","name":"Name","error":"Error","info":"Information","viewallcourses":"View all courses","morehelp":"More help","loadinghelp":"Loading...","cancel":"Cancel","yes":"Yes","confirm":"Confirm","no":"No","areyousure":"Are you sure?","closebuttontitle":"Close","unknownerror":"Unknown error"},"repository":{"type":"Type","size":"Size","invalidjson":"Invalid JSON string","nofilesattached":"No files attached","filepicker":"File picker","logout":"Logout","nofilesavailable":"No files available","norepositoriesavailable":"Sorry, none of your current repositories can return files in the required format.","fileexistsdialogheader":"File exists","fileexistsdialog_editor":"A file with that name has already been attached to the text you are editing.","fileexistsdialog_filemanager":"A file with that name has already been attached","renameto":"Rename to \"{$a}\"","referencesexist":"There are {$a} alias\/shortcut files that use this file as their source","select":"Select"},"block":{"addtodock":"Move this to the dock","undockitem":"Undock this item","dockblock":"Dock {$a} block","undockblock":"Undock {$a} block","undockall":"Undock all","hidedockpanel":"Hide the dock panel","hidepanel":"Hide panel"},"langconfig":{"thisdirectionvertical":"btt"},"admin":{"confirmation":"Confirmation"}};
  194. //]]>
  195. </script>
  196. <script type="text/javascript">
  197. //<![CDATA[
  198. var navtreeexpansions3658 = [{"id":"expandable_branch_30_8920","key":"8920","type":30},{"id":"expandable_branch_30_9006","key":"9006","type":30},{"id":"expandable_branch_30_9007","key":"9007","type":30},{"id":"expandable_branch_30_9008","key":"9008","type":30},{"id":"expandable_branch_30_9009","key":"9009","type":30},{"id":"expandable_branch_30_9010","key":"9010","type":30},{"id":"expandable_branch_30_9011","key":"9011","type":30},{"id":"expandable_branch_30_9012","key":"9012","type":30},{"id":"expandable_branch_30_9013","key":"9013","type":30},{"id":"expandable_branch_30_9014","key":"9014","type":30},{"id":"expandable_branch_30_9015","key":"9015","type":30},{"id":"expandable_branch_30_9017","key":"9017","type":30},{"id":"expandable_branch_30_9018","key":"9018","type":30},{"id":"expandable_branch_30_9019","key":"9019","type":30},{"id":"expandable_branch_30_9020","key":"9020","type":30},{"id":"expandable_branch_0_mycourses","key":"mycourses","type":0},{"id":"expandable_branch_0_courses","key":"courses","type":0}];
  199. //]]>
  200. </script>
  201. <script type="text/javascript">
  202. //<![CDATA[
  203. YUI().use('node', function(Y) {
  204. M.util.load_flowplayer();
  205. setTimeout("fix_column_widths()", 20);
  206. Y.use("moodle-core-dock-loader",function() {M.core.dock.loader.initLoader();
  207. });
  208. Y.use("moodle-filter_mathjaxloader-loader",function() {M.filter_mathjaxloader.configure({"mathjaxconfig":"MathJax.Hub.Config({\r\n config: [\"MMLorHTML.js\", \"Safe.js\"],\r\n jax: [\"input\/TeX\",\"input\/MathML\",\"output\/HTML-CSS\",\"output\/NativeMML\"],\r\n extensions: [\"tex2jax.js\",\"mml2jax.js\",\"MathMenu.js\",\"MathZoom.js\"],\r\n TeX: {\r\n extensions: [\"AMSmath.js\",\"AMSsymbols.js\",\"noErrors.js\",\"noUndefined.js\"]\r\n },\r\n menuSettings: {\r\n zoom: \"Double-Click\",\r\n mpContext: true,\r\n mpMouse: true\r\n },\r\n errorSettings: { message: [\"!\"] },\r\n skipStartupTypeset: true,\r\n messageStyle: \"none\"\r\n});\r\n","lang":"en"});
  209. });
  210. Y.use("moodle-block_navigation-navigation",function() {M.block_navigation.init_add_tree({"id":"3658","instance":"3658","candock":true,"courselimit":"100","expansionlimit":"30"});
  211. });
  212. Y.use("moodle-block_navigation-navigation",function() {M.block_navigation.init_add_tree({"id":"3659","instance":"3659","candock":true});
  213. });
  214. M.util.help_popups.setup(Y);
  215. Y.use("moodle-core-popuphelp",function() {M.core.init_popuphelp();
  216. });
  217. M.util.init_block_hider(Y, {"id":"inst3658","title":"Navigation","preference":"block3658hidden","tooltipVisible":"Hide Navigation block","tooltipHidden":"Show Navigation block"});
  218. M.util.init_block_hider(Y, {"id":"inst3659","title":"Administration","preference":"block3659hidden","tooltipVisible":"Hide Administration block","tooltipHidden":"Show Administration block"});
  219. M.util.js_pending('random545a7254b9f424'); Y.on('domready', function() { M.util.js_complete("init"); M.util.js_complete('random545a7254b9f424'); });
  220.  
  221. });
  222. //]]>
  223. </script>
  224.  
  225. </div>
  226. </body>
  227. </html>
Advertisement
Add Comment
Please, Sign In to add comment