Difference between revisions of "CSC111 Final Exam 2015"
Line 3: | Line 3: | ||
=Problem 1= | =Problem 1= | ||
<br /> | <br /> | ||
− | This problem is based on [[CSC111_Homework_11_2015| Homework 11]]. In Problem 1 of Homework 11, the user is asked to enter the name of a file, and then the program outputs statistics about the data stored in the file. In this exam problem, the user may enter the name of '''several files''', one after the other. There is no limit on the number of files the user enters. The exam program then outputs the coldest temperature recorded, followed by the | + | This problem is based on [[CSC111_Homework_11_2015| Homework 11]]. In Problem 1 of Homework 11, the user is asked to enter the name of a file, and then the program outputs statistics about the data stored in the file. In this exam problem, the user may enter the name of '''several files''', one after the other. There is no limit on the number of files the user enters. The exam program then outputs the coldest temperature recorded over all the cities specified, followed by groups of city name, month, and year when it was recorded. For example, if the user specifies two files, and the coldest temperature in the first file is -4.2, and the coldest in the second file is -5.7, then the program only output -5.7, along with the name of the city associated with the second file, along with the month and year when -5.7 was recorded. If -5.7 is found several times in the tmin column of the file, then all occurrences are reported (see Example section below). |
+ | <br /> | ||
+ | ==Data Files== | ||
+ | <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. | ||
+ | * When your program is tested, it will be given synthetic files that will have been modified to fully test your program, and it is possible that all the files will contain the same lowest temperature. | ||
<br /> | <br /> | ||
==Requirements== | ==Requirements== | ||
<br /> | <br /> | ||
* Store your program in a file called '''final1.py'''. | * Store your program in a file called '''final1.py'''. | ||
− | * The | + | * The program should get the names of the temperature files as one long line (see Example section below). |
<br /> | <br /> | ||
==Example== | ==Example== | ||
Line 21: | Line 26: | ||
<br /> | <br /> | ||
− | * | + | * Notice how the user enters all the files of interest on one line |
* The program outputs the coldest temperature (-8.6, found in the tmin column of the files), followed by groups of 3 fields, where the first one is the city name (not the file name), the month (expressed as 3 letters), and the year. | * The program outputs the coldest temperature (-8.6, found in the tmin column of the files), followed by groups of 3 fields, where the first one is the city name (not the file name), the month (expressed as 3 letters), and the year. | ||
− | * All fields are | + | * 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. | ||
<br /> | <br /> | ||
==Submission== | ==Submission== |