Difference between revisions of "CSC111 Final Exam 2014"

From dftwiki3
Jump to: navigation, search
Line 49: Line 49:
 
</source>
 
</source>
 
<br />
 
<br />
The list above is a list of people, dogs, and cats.  In order to use it in the program you have to write and that you will be submitting, simply add this line at the top of your program:
+
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 71: 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 83: 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 111: Line 113:
 
==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 118: Line 120:
 
==Implementation Details==
 
==Implementation Details==
 
<br />
 
<br />
* The soft mask should be as big as the width or the height of the image, whichever is smaller
+
* The circular part of the mask should be as big as the width or the height of the image, whichever is smaller
* The fog can be white or black, depending on your own preference
+
* The mask color '''must''' be white.
* The image is fully white or fully black outside the "circle of fog"
+
* 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 127: Line 129:
 
==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.
* You should submit the result of applying your program to the same URL as indicated in Problem #1.
+
 
 
<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''' as possible.  You do not have to reproduce the text in the image;  just the tree, its colors, and its fruits.
+
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 139: Line 141:
 
* 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 in the graphics: "orange", "blue", and "brown".
+
* I used only 3 colors to generate the tree above: "orange", "blue", and "brown".
 +
<br />
 
<br />
 
<br />
 
<br />
 
<br />
 +
Good luck!
 
<br />
 
<br />
 
<br />
 
<br />

Revision as of 08:48, 2 May 2014


...