📄 readme.html
字号:
you should not alter. Place your implementation for the evaluator in your own<tt>eval.cpp</tt> file, replacing the dummy <tt>eval.cpp</tt> that came withthe parser.</p><p>When you're implementing the <tt>eval</tt> function, think carefully aboutall the different cases (what type are the operands?) The <tt>+</tt> and<tt>if</tt> functions can be applied to any combination of the numeric intand double types, but what is the return type? The <tt>ceiling</tt> functioncan be applied to double types, but not int types. No function can be appliedto the symbol type (yet).</p><h3>Putting it all together</h3><p>Notice that the dummy example implementation of <tt>eval.cpp</tt> that youhave been given doesn't do anything useful. It just returns the same<tt>Cell*</tt> that was passed to it. That's why running the <tt>main</tt>program prints out the same s-expression that you give it as input. Afteryou've correctly replaced <tt>eval.cpp</tt> with your real evaluatorimplementation, running the same <tt>main</tt> program will instead print outthe result of evaluation---which is exactly what we want!</p><p>So you don't need to touch <tt>main.cpp</tt> at all. Good encapsulation atwork, again!</p><h3>Important reminders</h3><p>You must follow the design approach outlined in this document. Do<em>not</em> just implement the required functionality using a differentdesign. Your proper <em>software engineering</em> skills are being graded.</p><p>Do <em>not</em> use virtual functions or templates in this assignment.This assignment is about static OO support in C++. (You'll get a chance touse dynamic OO polymorphism and templates in the following assignments...)</p><p>Do <em>not</em> edit the files <tt>parse.hpp</tt>, <tt>parse.cpp</tt>,<tt>cons.hpp</tt>, <tt>eval.hpp</tt>, or <tt>main.cpp</tt>. The programmingassignments are mini-exercises in how multiple programmers are supposed tointeract and communicate in the real world; these files are <em>owned</em>and <em>maintained</em> by the other author(s).</p><p>You will need to add things to <tt>Cell.hpp</tt>, but do <em>not</em>delete anything from it. Replace the files <tt>Cell.cpp</tt> and<tt>eval.cpp</tt> with your own implementations. Depending on your approach,you may or may not also wish to add more files.</p><p>Depending on your approach, you may or may not need to change the<tt>Makefile</tt> (as in Lab 1). Whether you changed it or not, always makesure you include whatever <tt>Makefile</tt> is needed to build your program,when you submit the assignment. Otherwise, the graders cannot build yourprogram.</p><p>Documentation is also a critically important part of your softwareengineering. Your use of <tt>doxygen</tt> comments, as in Lab 3, will begraded.</p><p>You must write the final version of the program on your own. Sophisticatedplagiarism detection systems are in operation, and they are pretty good atcatching copying! If you worked in study groups, you must also acknowledgeyour collaborators in the write-up for each problem, whether or not they areclassmates. Other cases will be dealt with as plagiarism. Re-read the policyon the course home page, and note the University's tougher policy this yearregarding cheating.</p><p>Your programming style (how clearly and how well you speak C++) is whatwill be graded. Correct functioning of your program is necessary but notsufficient!</p><h3>Grading scheme</h3><p>Below is the <strong>grading sheet</strong> that will be used by thegraders, so you can see what software engineering skills they're checking youfor.</p><p>Your grade consists of two parts: (1) <strong>programcorrectness</strong>, worth 60%. and (2) <strong>style & design</strong>,worth 40%. Points are deducted for the error types as shown (but the minimumyou can get for each part is 0%, so you cannot get negative point scores oneither program correctness or style & design).</p><p>To assist you with your own testing and debugging, examples of the simple,general, and invalid input test cases (similar to the real ones that will beused by the graders) are found in the files <tt>testinput_simple.txt</tt>,<tt>testinput_general.txt</tt>, and <tt>testinput_invalid.txt</tt>,respectively. The correct results for the valid cases are found in the files<tt>testreference_simple.txt</tt> and <tt>testreference_general.txt</tt>.</p><table border="1"> <tr> <td><strong>Name:</strong> </td> <td>聽</td> </tr> <tr> <td><strong>Email:</strong> </td> <td>聽</td> </tr> <tr> <td><strong>Submission Time: </strong></td> <td>聽</td> </tr> <tr> <td><strong>Late Penalty:</strong> </td> <td>聽</td> </tr> <tr> <td><strong>Total Pts: </strong></td> <td>聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽/ 100 Pts</td> </tr></table><p></p><table border="2"> <tr> <td colspan="3"><strong>PROGRAM CORRECTNESS</strong> (Maximum: 60 Pts; Minimum: 0 Pts)</td> </tr> <tr> <td><em>Description</em></td> <td><em>Pts</em></td> <td><em>Notes</em></td> </tr> <tr> <td>Base Pts. (+60 Pts)</td> <td>聽聽聽聽聽聽聽聽聽</td> <td>聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</td> </tr> <tr> <td>Program fails to compile. (-60 Pts)</td> <td>聽</td> <td>聽</td> </tr> <tr> <td>Cell class fails (link against reference solution and run tests) (-60 Pts)</td> <td>聽</td> <td>聽</td> </tr> <tr> <td>eval() does not pass simple test cases. (-15 Pts)</td> <td>聽</td> <td>聽</td> </tr> <tr> <td>eval() does not pass general test cases. (-15 Pts)</td> <td>聽</td> <td>聽</td> </tr> <tr> <td>eval() does not handle semantically invalid cases. (-15 Pts)</td> <td>聽</td> <td>聽</td> </tr> <tr> <td>Does print() print s-expressions properly? (-20 Pts)</td> <td>聽</td> <td>聽</td> </tr> <tr> <td>Program prints irrelevant information. (-10 Pts)</td> <td>聽</td> <td>聽</td> </tr> <tr> <td>Encapsulation (Min -40 Pts) <ul> <li>Edited parse.hpp, parse.cpp, cons.hpp, eval.hpp, or main.cpp. (-40 Pts)</li> <li>Accessed functions in the Cell class directly. (-30 Pts)</li> </ul> </td> <td>聽</td> <td>聽</td> </tr> <tr> <td>BONUS: Proper destruction (+10 Pts)</td> <td>聽</td> <td>聽</td> </tr> <tr> <td>BONUS: Detailed error messages (+5 Pts)</td> <td>聽</td> <td>聽</td> </tr> <tr> <td>BONUS: Expressions like <tt>((if 1 + ceiling) 3.1)</tt> (+5 Pts)</td> <td>聽</td> <td>聽</td> </tr> <tr> <td>聽</td> <td>聽</td> <td>聽</td> </tr> <tr> <td colspan="2"><strong>STYLE & DESIGN</strong> (Maximum: 40 Pts; Minimum: -100 Pts)</td> <td></td> </tr> <tr> <td><em>Description</em></td> <td><em>Pts</em></td> <td><em>Notes</em></td> </tr> <tr> <td>Base Pts. (+40 Pts)</td> <td>聽</td> <td>聽</td> </tr> <tr> <td>No Doxygen output. (-10 Pts)</td> <td>聽</td> <td>聽</td> </tr> <tr> <td>Inadequate function level documentation. (-10 Pts)</td> <td>聽</td> <td>聽</td> </tr> <tr> <td>Inadequate algorithm level (i.e. within function) documentation. (-15 Pts)</td> <td>聽</td> <td>聽</td> </tr> <tr> <td>Inadequate variable level documentation (i.e. meaning of the variable). (-10 Pts)</td> <td>聽</td> <td>聽</td> </tr> <tr> <td>Poor readability of function and variable names. (-10 Pts)</td> <td>聽</td> <td>聽</td> </tr> <tr> <td>Improper use of indentation and space. (-10 Pts)</td> <td>聽</td> <td>聽</td> </tr> <tr> <td>Inconsistent naming of functions and variables. (-10 Pts)</td> <td>聽</td> <td>聽</td> </tr> <tr> <td>Incorrect ‘const’ usage. (-10 Pts)</td> <td>聽</td> <td>聽</td> </tr> <tr> <td>Improper private data encapsulation. (-10 Pts)</td> <td>聽</td> <td>聽</td> </tr></table><hr /><p style="text-align: right"><i>Last updated: 2007.03.05 dekai</i></p></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -