Difference between revisions of "CSC111 Final Exam 2014"
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | + | ||
<br /> | <br /> | ||
Line 7: | Line 7: | ||
'''This final exam is take-home'''. It is open-books, open-notes, and open-Web. ''' It is due''' a week after it is made available, '''at 4:00 p.m.''' on Friday May 9th, 2014. | '''This final exam is take-home'''. It is open-books, open-notes, and open-Web. ''' It is due''' a week after it is made available, '''at 4:00 p.m.''' on Friday May 9th, 2014. | ||
− | '''You cannot discuss the details of this exam with anyone except your instructor'''. You cannot work in pair-mode. The TAs are '''not allowed''' to help you out in any way. No question will be answered in person after the last CSC111 class. All questions about the exam should be posted | + | '''You cannot discuss the details of this exam with anyone except your instructor'''. You cannot work in pair-mode. The TAs are '''not allowed''' to help you out in any way. No question will be answered in person after the last CSC111 class. All questions about the exam should be posted on Piaza. If you are not sure whether your question should be made public because it might contain revealing information about your code, make your question private when you post it. |
'''The exam is given under the rules of the Smith College [http://www.smith.edu/sao/handbook/socialconduct/honorcode.php Honor Code].''' | '''The exam is given under the rules of the Smith College [http://www.smith.edu/sao/handbook/socialconduct/honorcode.php Honor Code].''' | ||
− | Make sure you reference all work/resources in the header of your code. This | + | Make sure you reference all work/resources in the header of your code. This includes Web sites you visited and from which you may have taken some code sections. You do not need to reference any code taken from the CSC111 class pages. |
− | You must submit a solution for Problem 1, and one solution for either Problem 2 or Problem 3. You may submit solutions for all three problems. In this case the exam grade will be computed as ''gradeProblem1'' + '''max'''( ''gradeProblem2'', ''gradeProblem3'' ). | + | You must submit a solution for Problem 1, and one solution for either Problem 2 or Problem 3. You may submit solutions for all three problems. In this case the exam grade will be computed as ''gradeProblem1'' + '''max'''( ''gradeProblem2'', ''gradeProblem3'' ). All programs are worth 50 points max. |
</bluebox> | </bluebox> | ||
<br /> | <br /> | ||
− | + | <onlydft> | |
<br /> | <br /> | ||
=Problem #1 (50 points)= | =Problem #1 (50 points)= | ||
<br /> | <br /> | ||
− | Store the code below in a file called '''finaltext.py'''. | + | <br /> |
+ | <font color="magenta">Store the code below in a file called '''finaltext.py'''.</font> | ||
+ | <br /> | ||
<br /> | <br /> | ||
<source lang="python"> | <source lang="python"> | ||
Line 41: | Line 43: | ||
dog, Oscar, 4, Beagle, not vaccinated, not trained, tattooed, Alexandra | dog, Oscar, 4, Beagle, not vaccinated, not trained, tattooed, Alexandra | ||
dog, Mirabelle, 4, Beagle, vaccinated, trained, not tattooed, Alexandra | dog, Mirabelle, 4, Beagle, vaccinated, trained, not tattooed, Alexandra | ||
− | cat, Jabba, 3, | + | cat, Jabba, 3, Persian, vaccinated, outdoors, not tattooed, Francis |
− | cat, Yago, 3, | + | cat, Yago, 3, Toyger, vaccinated, outdoors, tattooed, George |
− | cat, Calico, 5, | + | cat, Calico, 5, Persian, not vaccinated, indoors, not tattooed, Alexandra |
− | cat, Callas, 4, | + | cat, Callas, 4, Toyger, not vaccinated, outdoors, tattooed, George""" |
</source> | </source> | ||
<br /> | <br /> | ||
− | The list above is a list of people, dogs, and cats. In order to use it in | + | The list above is a list of people, dogs, and cats. In order to use it in your program simply add this line at the top of your program: |
+ | <br /> | ||
<br /> | <br /> | ||
<source lang="python"> | <source lang="python"> | ||
from finaltext import text | from finaltext import text | ||
</source> | </source> | ||
+ | <br /> | ||
<br /> | <br /> | ||
==Your Assignment== | ==Your Assignment== | ||
<br /> | <br /> | ||
− | Write a program called '''finala.py''' that will read this string '''text''', parse it, store it in some data structure, and output the answers to the following questions: | + | Write a program called '''finala.py''' that will read this string '''text''', parse it, store it in '''some data structure''', and output the answers to the following questions: |
;Question 1 | ;Question 1 | ||
:Print a list of all the people, nicely formatted, followed by a list of the dogs, followed by a list of the cats. An example of the format to use is shown below: | :Print a list of all the people, nicely formatted, followed by a list of the dogs, followed by a list of the cats. An example of the format to use is shown below: | ||
Line 69: | Line 73: | ||
Alexandra (Alexandra2013yoyo@gmail.com), 79 years old, single, lives in Northampton, 2 dogs, 1 cat | Alexandra (Alexandra2013yoyo@gmail.com), 79 years old, single, lives in Northampton, 2 dogs, 1 cat | ||
− | :If the person does not own pets, then do not add anything after the city where they live. | + | :If the person does not own pets, then do not add anything after the city where they live. Do not print a comma at the end of the line! |
;Question 3 | ;Question 3 | ||
Line 81: | Line 85: | ||
;Question 6 | ;Question 6 | ||
− | : Print the email addresses of all the people who have unvaccinated pets, so that we can remind them to have them vaccinated. | + | : Print the email addresses, and only the email addresses, of all the people who have unvaccinated pets, so that we can remind them to have them vaccinated. |
==Grading== | ==Grading== | ||
− | * A maximum of 30 points will be given to well documented programs that answer all questions using regular parsing methods, but not using any new classes. | + | * A maximum of '''30 points''' will be given to well documented programs that answer all questions using regular parsing methods, but not using any new classes. |
− | * A maximum of 40 points will be given to well documented programs that answer all the questions and that create new classes and objects to hold the various pieces of information. | + | * A maximum of '''40 points''' will be given to well documented programs that answer all the questions and that create new classes and objects to hold the various pieces of information. |
− | * A maximum of 50 points will be given to well documented programs that answer all the questions and that use classes derived from the People and Dog classes of [[CSC111_Homework_10_2014#Problem_.232:_Of_dogs_and_people... | Problem 2 of Homework 10]]. In this case you must copy and not modify the two classes into your program, and create new classes derived from them. Feel free to organize your new classes as you feel will help you answer the questions the most easily. In other words, make life easy for yourself! | + | * A maximum of '''50 points''' will be given to well documented programs that answer all the questions and that use classes derived from the People and Dog classes of [[CSC111_Homework_10_2014#Problem_.232:_Of_dogs_and_people... | Problem 2 of Homework 10]]. In this case you must copy and not modify the two classes into your program, and create new classes derived from them. Feel free to organize your new classes as you feel will help you answer the questions the most easily. In other words, make life easy for yourself! |
<br /> | <br /> | ||
Line 97: | Line 101: | ||
<br /> | <br /> | ||
+ | |||
=Problem #2 (50 points)= | =Problem #2 (50 points)= | ||
<br /> | <br /> | ||
Line 109: | Line 114: | ||
==Testing== | ==Testing== | ||
<br /> | <br /> | ||
− | Run your program on the following image, and submit a copy of the processed image. | + | Run your program on the following image, and submit a copy of the processed image under the name '''finalb.jpg''' or '''finalb.png'''. |
<br /> | <br /> | ||
<center>[[File:SmithCollegeStainedGlass.jpg|300px]]<br />(click on the image twice to get to the real full size image)</center> | <center>[[File:SmithCollegeStainedGlass.jpg|300px]]<br />(click on the image twice to get to the real full size image)</center> | ||
Line 116: | Line 121: | ||
==Implementation Details== | ==Implementation Details== | ||
<br /> | <br /> | ||
− | * The | + | * The circular part of the mask should be as big as the width or the height of the image, whichever is smaller |
− | * The | + | * The mask color '''must''' be white. |
− | * The image | + | * The resulting image should be fully white outside the circular mask. |
* The amount of softness inside the circle is up to you. But there should be some softening of the colors! The pixel at the very center of the foggy image should retain its original color. | * The amount of softness inside the circle is up to you. But there should be some softening of the colors! The pixel at the very center of the foggy image should retain its original color. | ||
* Your JES program should only ask the user for a file name, nothing else. | * Your JES program should only ask the user for a file name, nothing else. | ||
Line 125: | Line 130: | ||
==Submission== | ==Submission== | ||
<br /> | <br /> | ||
− | * Your program should be called '''finalb.py''' | + | * Your program should be called '''finalb.py''' and the image '''finalb.png''' or '''finalb.jpg''', and both should be submitted to the URL indicated in Problem #1 above. |
− | + | ||
<br /> | <br /> | ||
<br /> | <br /> | ||
=Problem #3: An Orange Tree (50 points)= | =Problem #3: An Orange Tree (50 points)= | ||
<br /> | <br /> | ||
− | Write a well documented and organized Python program that will generate a tree ''as close to the tree shown below | + | Write a well documented and organized Python program that will generate a tree ''as close to the tree shown below'' as possible. You should not reproduce the text in the image; '''just the tree, its colors, and its fruit.''' |
<br /> | <br /> | ||
<center>[[Image:FractalTreeWithLeaves.png| 500px]]</center> | <center>[[Image:FractalTreeWithLeaves.png| 500px]]</center> | ||
Line 137: | Line 142: | ||
* Call your program '''finalc.py''' and the image '''finalc.jpg''' or '''finalc.png'''. Submit both to the same URL indicated in Problem #1. | * Call your program '''finalc.py''' and the image '''finalc.jpg''' or '''finalc.png'''. Submit both to the same URL indicated in Problem #1. | ||
* If you need help capturing the final image, please visit [http://www.take-a-screenshot.org/ this page]. | * If you need help capturing the final image, please visit [http://www.take-a-screenshot.org/ this page]. | ||
− | * Note: To change the color of a '''line''' with the graphics library, you should use the '''setOutline()''' method rather than the '''setFill()''' method. | + | * Note: To change the color of a '''line''' with the graphics library (use graphics111.py, please), you should use the '''setOutline()''' method rather than the '''setFill()''' method. |
− | * I used only 3 colors | + | * I used only 3 colors to generate the tree above: "orange", "blue", and "brown". |
<br /> | <br /> | ||
<br /> | <br /> | ||
<br /> | <br /> | ||
+ | Good luck! | ||
<br /> | <br /> | ||
<br /> | <br /> | ||
− | |||
</onlydft> | </onlydft> | ||
+ | <br /> |
Latest revision as of 08:13, 27 April 2018
CSC111 Final Take-Home Exam 2014
This final exam is take-home. It is open-books, open-notes, and open-Web. It is due a week after it is made available, at 4:00 p.m. on Friday May 9th, 2014.
You cannot discuss the details of this exam with anyone except your instructor. You cannot work in pair-mode. The TAs are not allowed to help you out in any way. No question will be answered in person after the last CSC111 class. All questions about the exam should be posted on Piaza. If you are not sure whether your question should be made public because it might contain revealing information about your code, make your question private when you post it.
The exam is given under the rules of the Smith College Honor Code.
Make sure you reference all work/resources in the header of your code. This includes Web sites you visited and from which you may have taken some code sections. You do not need to reference any code taken from the CSC111 class pages.
You must submit a solution for Problem 1, and one solution for either Problem 2 or Problem 3. You may submit solutions for all three problems. In this case the exam grade will be computed as gradeProblem1 + max( gradeProblem2, gradeProblem3 ). All programs are worth 50 points max.