Assignment 2

Due 9pm Sunday, July 30th 11pm Monday, July 31st

The main components of this assignment are threefold - string processing, reading from files, and dictionaries.

Your assignment is to build a unit conversion program that reads all its conversion factors from a file and then alows a user to enter the units to convert from, the units to convert to, and the quantity. An example interaction follows:

Hello!  I am a unit conversion program.  I can convert many units to
many other units.  What would you like to convert from?
I support the following units:
   feet
   miles
   meters
   yards
   inches
What would you like to convert from? inches
What would you like to convert to? meters
How much would you like to convert? 74.5
74.5 inches in meters is 1.89230000193

The units file I would like you to read is conversion_table (you should download the file and read it locally. Dynamically updating it from the website would be extra credit...). Note that only half of the possible conversions are specified in the file, but the other half can be figured out. In the example above, note that we have the conversion factor from inches to meters in the supplied table, but asked the program to calculate meters to inches.

Good luck, and don't hesitate to contact me with questions. If you post comments below, I will be able to respond to you and then everyone else can read the answer and hopefully become less confused over time.

Boilerplate

Ask me if there are any questions, and remember that elegance counts! peter@cs.uoregon.edu, or simply commenting below will all reach me immediately. Also recommended is coming in to office hours if you have any questions.

Turn It In

Turn your project in using the following form:

What is your student #?
What is your name?
What is your email?
What file would you like to submit?
If you have more than one file in your project, please use an archiving tool to put them all into one archive file. Acceptable archive types are .zip, .jar, .tar, and .tgz.

Please make sure that you provide any README files in plain text. MS Word .doc files are not acceptable. .html, .txt, .ps, .dvi, and .pdf are all acceptable. Really you should just be turning in ASCII text (.txt) files and source code. And for most assignments, just well documented source code.

Comments and Clarifications

The admin should touch /cs/classweb/06U/cis122/2.comment

Questions? Answers!
Valid CSS! Valid XHTML 1.1!