Re: QUICKCHECK Your Assignment 3 Submission
Dear CSCI-316 Students,
This is the second of two messages I am sending you at this time. (The first e-mail explained how you can use QUICKCHECK to run some tests on your Assignment 3 submission.)
Solutions to the Assignment 3 problems are now available to you on mars. The solutions are written in Scheme, the dialect of Lisp used in the course reader (partly to give you some practice in reading simple Scheme code).
IMPORTANT: This email assumes you have done reading assignment C in my email of October 2.
The Scheme PDF document on Brightspace provides further information that will help you to understand Scheme code.
Important Notes on Exam Questions
On Exam 1 and the final exam you MAY be required to read Scheme code that can be understood using the information in the above-mentioned PDF file. However, you will NOT be asked to write Scheme code, only Common Lisp code. (In fact, many students in past semesters have lost points for writing some of their code in Scheme instead of Common Lisp—e.g., using (else ...) as the last clause of a COND, or using define instead of defun in a function definition!)
Viewing Solutions
To see my solutions to Assignment 3, logon to your xxxxx_yyyy316 mars account and enter the command scm to start the kawa Scheme interpreter, as explained in the above-mentioned Scheme PDF file on Brightspace. (Enter scm, NOT scheme!) When the #|kawa:1|# prompt appears after you enter the scm command, enter the following to load my solutions:
(load "/home/faculty/ykong/316/A3-kawa.sol")
You should then get a #|kawa:2|# prompt. At this prompt you can display a definition of any function you were asked to write for Assignments 3 by entering:
(pretty-print <function name in lowercase>$)
Notice the $ after the function name! For example, enter:
(pretty-print odd-gt-million$)
after loading my solutions as explained above to display a solution to problem 3. (Ignore the number that is printed immediately below the function definition!)
You can test my solutions by calling the functions. For example, after loading A3-kawa.sol you could enter:
(safe-avg 23.1 41.3)
at Scheme’s prompt.
You can exit Scheme by typing Ctrl-D or by entering (exit) at Scheme’s prompt.
Multiple Solutions
Many of these problems (like other programming problems) can be solved in more than one good way. So your solution to a problem might be correct even if it is different from mine! For example, you can use EQ or EQL instead of EQUAL for the MONTH->INTEGER problem, because at least one of the arguments passed to each of the calls of EQUAL is a symbol.
Nevertheless, you should make sure you understand my solutions even if you think your solutions are correct! One reason is that there might well be one or more questions on EXAM 1 and/or the FINAL EXAM that ask you to “fill in the gaps” in an incomplete Lisp function that works in a similar way to my solution to a problem!
Guidelines for Reading Solutions
To those students who have not yet finished working on Assignment 3: At this stage you should not look at a solution to a problem until after you have either solved it yourself, or have spent some time (e.g., 30 minutes) working on that particular problem! (Accordingly, these solutions are presented one problem at a time: This prevents you from accidentally seeing a solution to a problem that you have not yet “given up” on.)
Resubmission and Late Penalties
If you were unable to solve one or more of the assignment problems before the assignment’s due date, or you discover an error in your submitted solutions, then you can RESUBMIT the assignment with corrections and additions if you wish! (Follow the submission instructions in the assignment document, using the very same command on mars.) This paragraph applies to Assignment 2 and future programming assignments as well as Assignment 3. Any resubmission made after an assignment’s due date counts as a LATE submission.
Possible penalties for late submission were explained on p. 3 of the 1st-Day-Announcements document, in the last paragraph of the “Assignments and Late Submission Policy” section. As you may have noticed from reading that paragraph, once you have made a LATE submission of a particular assignment (e.g., by making a resubmission of that assignment after its due date) there will not be any additional penalty for further resubmissions of that same assignment. For example, if you resubmit Assignment 3 twice and later resubmit Assignment 4 three times after its due date, then your number of assignments submitted late will be TWO (and not five).
As stated in the 2nd-last paragraph of the same section, late assignment submissions will be accepted until the deadline for late submission, which will be announced in December (and will not be before your final exam).
See you in class.
T. Yung Kong, D.Phil.
Professor
Computer Science Department
Queens College, CUNY
Flushing, NY 11367, U.S.A.