CS670K Machine Problem 3 - Fall 1998

Due: Thursday, December 17

© Copyright University of New Haven 1998

Home Page

For this assignment, please make the following 2 modifications to the Fahrenheit to Celsius converter applet, discussed in class, and given below:

  1. Instead of a 1-directional Fahrenheit to Celsius converter, please make a Bi-directional temperature converter so that a value entered in the Fahrenheit text box causes the corresponding Celsius value to appear in the Celsius text box, AND a value entered in the Celsius text box causes the corresponding Celsius value to appear in the Fahrenheit text box.

  2. Please add a check for temperatures below Absolute Zero (-273° Celsius and the equivalent Fahrenheit temperature). Display an (annoying) message box which the user must dismiss (e.g. by clicking a OK button) before further temperature conversions can proceed.

Click here to run a sample solution. Note that this solution reacts sensibly to any input values. Since I prefer keystrokes over action keys to signal re-calculation, it does not display 2 inconsistent temperature values. (You may choose action keys events, if you prefer, since bi-directional text boxes are a bit harder to debug.) To display the warning message box, enter a value less than -273° Celsius.

The closer your solution comes to this sample, the more credit it will receive, but feel free to improve on it by adding an extra feature that you think might be useful.

Instructions on how to submit your solution are given below. They are the same as they were for the previous machine problems.

Click here to see the Fahrenheit to Celsius converter given in class, using the 1.0 event model. It has been modified slightly to run either as an applet, or stand-alone.

How to submit your solution

By the due date:
  1. Email your Java program to me at okrent@cs.newhaven.edu.
  2. In your System2 pub sub-directory, store your compiled class files, and create an HTML file named FC.html to display the applet. Here is a sample FC.html file:
    <HTML><BODY>
    <H1>Temperature Converter</H1>
    <APPLET CODE=FC WIDTH=10 HEIGHT=10></APPLET>
    </BODY></HTML>
    

How to Create and Use your pub Sub-directory

To upload your files, you may use any file transfer program. If you are working on an MS-Windows PC, and need a file transfer program, click here to upload WS_FTP, a (freeware to students) self-expanding file transfer program. (This is not likely to work for AOL users... you'll have to come to an Echlin hall lab to upload.)

BE SURE TO UPLOAD YOUR .class FILES IN BINARY MODE, not Ascii!!

If your attempt to view your applet gets an Access Denied message, it may be because your pub sub-directory is not readable by all users. To correct this, login to System2 (e.g using telnet), and type the following command:

chmod a+rx pub pub/*

Home Page