Difference between revisions of "CSC111 Final Exam 2015"

From dftwiki3
Jump to: navigation, search
Line 6: Line 6:
 
The exam is open book, and open Web.
 
The exam is open book, and open Web.
 
<br />
 
<br />
You have to do the work individually.  You cannot seek help from anybody for this exam.  The TAs will not have TA hours, and will not be allowed to answer any questions relating to Python.  All questions relating to this Final should be directed to your instructor, and posted on Piazza.  Questions relating to python constructs, or debugging code will not be addressed, and should not be answered by other students.   Only questions intended to help clarify different parts of the exam will be answered.
+
You have to do the work individually.  You cannot seek help from anybody for this exam.  The TAs will not have TA hours, and will not be allowed to answer questions relating to Python or the class material.  All questions relating to this Final should be directed to your instructor, and posted on Piazza.  Posting on piazza should not contain any code. Only questions meant to clarify the exam are allowed.  No debugging-related questions will be answered.  
 
<br />
 
<br />
 
The deadline for the exam is Friday,  '''May 8, at 4:00 p.m.'''  No extensions will be granted beyond this date and time.
 
The deadline for the exam is Friday,  '''May 8, at 4:00 p.m.'''  No extensions will be granted beyond this date and time.
Line 20: Line 20:
 
<br />
 
<br />
 
* Please download a new set of temperature-data files from the Smith URL indicated in Homework 11.  In particular, the armaghdata.txt and bramemardata.txt have been slightly modified to ensure that the coldest temperature is found in both cities.
 
* Please download a new set of temperature-data files from the Smith URL indicated in Homework 11.  In particular, the armaghdata.txt and bramemardata.txt have been slightly modified to ensure that the coldest temperature is found in both cities.
* When your program is tested, it will be given different files that will have been modified to have common lowest temperatures, to fully test your program, and it is possible that all the files will contain the same lowest temperature.
+
* When your program is tested, it will be given different files that will have been modified to have common lowest temperatures, to fully test your program, and it is possible that all the files will contain the same lowest temperature.  It is also possible that a file may contain only 1 line of temperature data.
 
<br />
 
<br />
 
==Requirements==
 
==Requirements==
Line 32: Line 32:
 
</source>
 
</source>
 
<br />
 
<br />
* The program should get the names of the temperature files as one long line (see Example section below).
+
* The program should get the names of the temperature files on one long line (see Example section below).
* If one of the names given is invalid (the file does not exist), your program should simply print "Invalid file name given." and stop, without outputting any temperature information, even if the other file names are valid. (The test program will check for the presence of the word "invalid" in your output.)
+
* If one of the names given is invalid (the file does not exist), your program should simply print "Invalid file name given" and stop, without outputting any temperature information, even if the other file names are valid. (The test program will check for the presence of the word "invalid" in your output.)
 
<br />
 
<br />
 
==Example==
 
==Example==
Line 57: Line 57:
 
  File names? <u>armaghdata.txt ballypatrickdata.txt bradforddata.txt braemardata.txt notAGoodFileName.zip</u>
 
  File names? <u>armaghdata.txt ballypatrickdata.txt bradforddata.txt braemardata.txt notAGoodFileName.zip</u>
 
   
 
   
  Invalid file name!
+
  Invalid file name.
 
   
 
   
 
<br />
 
<br />
Line 64: Line 64:
 
* All fields are printed on one line only, and separated by spaces.
 
* All fields are printed on one line only, and separated by spaces.
 
* If different cities contain the same lowest temperature, they are listed in alphabetical order.  For example, Armagh is listed before Braemar in the result line, above.
 
* If different cities contain the same lowest temperature, they are listed in alphabetical order.  For example, Armagh is listed before Braemar in the result line, above.
* Use the same prompt for your program ("File names?"), to make it easier to recognize the true output from the prompt.
+
* Use this prompt to ask the user to enter the file names: "File names?"
 
<br />
 
<br />
 
==Submission==
 
==Submission==
Line 70: Line 70:
 
* Submit your program the Final Problem 1 section on Moodle.
 
* Submit your program the Final Problem 1 section on Moodle.
 
<br />
 
<br />
=Problem 2: Frogger=
+
=Problem 2: Frogger Game=
 
<br />
 
<br />
 
<center><videoflash>plgm_p2zAek</videoflash></center>
 
<center><videoflash>plgm_p2zAek</videoflash></center>
 
<br />
 
<br />
 
(if the video does not show in the page, you can watch it on YouTube: [https://www.youtube.com/watch?v=plgm_p2zAek https://www.youtube.com/watch?v=plgm_p2zAek])
 
(if the video does not show in the page, you can watch it on YouTube: [https://www.youtube.com/watch?v=plgm_p2zAek https://www.youtube.com/watch?v=plgm_p2zAek])
Your assignment is to write a graphics program that implements the game illustrated in the video, with a few additional features.
+
Your assignment is to write a program that uses graphics, and that implements the game illustrated in the video, with a few additional features.
 
<br />
 
<br />
 
==Frog==
 
==Frog==
Line 145: Line 145:
 
* The number of cars used by the program is fixed and does not grow as the game evolves.  In the video, the number of cars is 3, but you can use more.  When a car disappears on one end of the screen it reappears on the other side, after a short delay.  The delay is up to you.
 
* The number of cars used by the program is fixed and does not grow as the game evolves.  In the video, the number of cars is 3, but you can use more.  When a car disappears on one end of the screen it reappears on the other side, after a short delay.  The delay is up to you.
 
* The frog moves up or down by a fixed amount.  To make the frog move up, the user must click the mouse in the area of the window above the road.  To make the frog move down, the user clicks the mouse in the area of the window below the road.
 
* The frog moves up or down by a fixed amount.  To make the frog move up, the user must click the mouse in the area of the window above the road.  To make the frog move down, the user clicks the mouse in the area of the window below the road.
* The frog "dies," or loses a ''life point'' when it is run over by a car.  You are free to determine the conditions for which the program will determine that the car is running over the frog.  In the video the top or bottom of the frog can overlap slightly a car without triggering the program to detect an overlap.  There is flexibility.
+
* The frog "dies," or loses a ''life point'' when it is run over by a car.  You are free to determine the conditions for which the program will determine that the car is running over the frog.  In the video the top or bottom of the frog can overlap slightly the body of a car without triggering the program to detect an overlap.  There is flexibility.
* The program automatically brings the frog back down, to its initial position, when a car runs over it, or when the frog has fully crossed the road.
+
* The program automatically brings the frog back down to its initial position when a car runs over it, or when the frog has fully crossed the road.
 
<br />
 
<br />
 
==Grading==
 
==Grading==
 
<br />
 
<br />
* Assuming that your program is well documented, and nicely organized, the following features will be worth various number of points.  A grade of 100 will be given to a will documented and organized program that behaves similarly to the game illustrated in the YouTube video, but with two lanes of cars, one lane going left to right, one going right to left.  The number of cars must remain constant, and cars disappearing on one end are made to reappear on the other side.
+
* Assuming that your program is well documented, and nicely organized with functions and classes, the following features will be worth various number of points.  A grade of 100 will be given to a will documented and organized program that behaves similarly to the game illustrated in the YouTube video, but with two lanes of cars, one lane going left to right, one going right to left.  The number of cars must remain constant, and cars disappearing on one end are made to reappear on the other side.
 
* Banner working correctly: 10 points
 
* Banner working correctly: 10 points
 
* Cars moving off the graphics window and reappearing on the other side: 10 points.
 
* Cars moving off the graphics window and reappearing on the other side: 10 points.
Line 195: Line 195:
 
* Click on this URL: [http://cs.smith.edu/dftwiki/media/twitterFeed.tx http://cs.smith.edu/dftwiki/media/twitterFeed.txt] and save the text that will display in your browser to a text file that you will call '''twitterFeed.txt''', in a directory of your choice on your computer.  Do not edit the information in the file, and do not remove anything from it, as your program needs to be able to treat it "as is," and will be tested with another file, similar in format, but with different contents.
 
* Click on this URL: [http://cs.smith.edu/dftwiki/media/twitterFeed.tx http://cs.smith.edu/dftwiki/media/twitterFeed.txt] and save the text that will display in your browser to a text file that you will call '''twitterFeed.txt''', in a directory of your choice on your computer.  Do not edit the information in the file, and do not remove anything from it, as your program needs to be able to treat it "as is," and will be tested with another file, similar in format, but with different contents.
 
<br />
 
<br />
==Example Interaction with the User==
+
== Interaction with the User==
 
<br />
 
<br />
 
* Below is an example of an interaction with the solution program:
 
* Below is an example of an interaction with the solution program:
 
<br />
 
<br />
  File name? twitterFeeeeeeeed.txt
+
  File name? <u>twitterFeeeeeeeed.txt</u>
 
  Invalid file name.  Please reenter
 
  Invalid file name.  Please reenter
  File name? twit.txt
+
  File name? <u>twit.txt</u>
 
  Invalid file name.  Please reenter
 
  Invalid file name.  Please reenter
  File name? twitterFeed.txt
+
  File name? <u>twitterFeed.txt</u>
 
  Location of interest? northampton
 
  Location of interest? northampton
 
  keyword of interest? Maya
 
  keyword of interest? Maya
File name? twitterFeed.txt
 
 
  --- Output ---
 
  --- Output ---
 
  252 tweets read
 
  252 tweets read
Line 216: Line 215:
 
<br />
 
<br />
 
* Your program must match this output as closely as possible, including the "---Output---" line.  Remember that your program will be tested with a collection of tweets that will be different, and probably gathered in a different time period, so your program must locate the oldest and newest tweets ''found'', and not simply output the dates shown above!
 
* Your program must match this output as closely as possible, including the "---Output---" line.  Remember that your program will be tested with a collection of tweets that will be different, and probably gathered in a different time period, so your program must locate the oldest and newest tweets ''found'', and not simply output the dates shown above!
* Note also that the date has been modified by the program, and is output as an 8-digit quantity, the year first, followed by the month, followed by the day.  Note also that April is represented by 04, and not 4.
+
* Note also that the date has been modified by the program, and is output as an 8-digit quantity; the year first, followed by the month, followed by the day.  Note also that April is represented by 04, and not 4.
 
<br />
 
<br />
 
==Requirements==
 
==Requirements==
Line 232: Line 231:
 
* Test your program well.  In particular, your program should be able to not crash if the file given to it contains only 1 entry, or if the file is empty.
 
* Test your program well.  In particular, your program should be able to not crash if the file given to it contains only 1 entry, or if the file is empty.
 
* You can assume that all entries will always contain 4 fields (date, location, screen-name, and text).
 
* You can assume that all entries will always contain 4 fields (date, location, screen-name, and text).
* When looking for the number of unique locations found in the tweets, "Northampton, MA" and "Northampton, Massachusetts" count as 2 different locations.  Basically if the lowercase versions of two different locations are not equal, the locations are distinct.  "Northampton MA" and "Northampton, MA" are distinct (because of the comma).  "northampton" and "Northampton" are the same.
+
* When looking for the number of unique locations found in the tweets, "Northampton, MA" and "Northampton, Massachusetts" count as 2 different locations.  Basically if the lowercase string versions of two different locations are not equal, the locations are distinct.  "Northampton MA" and "Northampton, MA" are distinct (because of the comma).  "northampton" and "Northampton" are the same.
 
<br />
 
<br />
 
==Submission==
 
==Submission==
Line 238: Line 237:
 
* Submit your program in the Final Problem 3 section.
 
* Submit your program in the Final Problem 3 section.
 
<br />
 
<br />
=Problem 4=
+
=Problem 4: Quiz=
 
<br />
 
<br />
Answer the questions in the Quizz section of the Final Exam section, on Moodle.
+
Answer the questions in the Quiz section of the Final Exam section, on Moodle.
 
<br />
 
<br />
 
<br />
 
<br />

Revision as of 07:44, 1 May 2015


...