CS 214 Project 9: Abstract Data Types


This week's exercise is to create a full-featured Temperature type. Such a type has the following attributes:

You are to build such a type in each of our four languages: Java, Ada, Clojure, and Ruby. Your type should take full advantage of the modularity features available in each language, as presented in this week's lab exercise.

Warning: This project is much longer than others have been. Begin immediately!

Details. Your Temperature type must provide the following operations:

Hint: To avoid redundant coding effort, write a utility method that, given a real value and a character value, returns true if and only if they constitute a valid temperature.

Testing. For each language, show that your Temperature type and its operations work correctly by writing a program that prints a temperature table. Your program should satisfy the following specification:

Turn in. Using an approach like what we did in the lab, make a single script file named proj09-results, in which you list each program, show that it builds without any syntax errors or warnings, and show same executions that demonstrate its correctness.

   cat java-script ada-script clojure-script ruby-script > proj09-script
Each language's script file should show the code you write in that language, the program building correctly, and the program executing using these input values:
  0 F
  100 C
  2.5
and
  0 K
  212 F
  20.0
Then submit your project by copying that single file into your personal folder in /home/cs/214/current/:
   cp proj09-results /home/cs/214/current/yourUserName
replacing yourUserName with your login name. The grader will access and grade your project results from there, using the criteria from this grade sheet.


Calvin > CS > 214 > Projects > 09


This page maintained by Joel Adams.