Projects‎ > ‎

Project 1

Browser-based Unit Conversion Tables

Due Thursday September 26th, at 11:59pm
Extended Deadline is Monday September 30th, at 11:59pm

Basic Functionality

For this project you are going to write a Python CGI (web) program that allows a user to print unit conversion tables.

Your input will be:
  • Units to convert (e.g., inches to centimeters)
  • Start value
  • End value
  • Step value
When the user presses submit, a table should be returned that displays the conversion table.  After the table is displayed, the user should be able to perform another conversion.

You should support the following conversions:
  • inches to centimeters
  • centimeters to inches
  • Fahrenheit to Celsius
  • Celsius to Fahrenheit
  • bytes to kilobytes
  • kilobytes to bytes
  • bytes to megabytes
  • megabytes to bytes
You should create a projects directory on your portfolio and create a link to your conversion program.

After displaying the table you should have a "retry" button that allows the user to create a new table.

Language Features

Your program should use the following language features:
  • HTML radio buttons for selected the conversion type
  • Iteration with while loops
  • functions
  • modules
  • cgi
  • Template strings
Be creative in your presentation of the input page and the resulting output pages.

  • 50 points Basic functionality described above
  • 50 points Language feature usage described above
Extra Credit
  • 5 points Error handling on user input, e.g.,values out of range or start > end
  • 5 points Creative HTML display