In this lab, you will write a Java program that uses a dialog box to prompt the user for a temperature in degrees Fahrenheit (for example -10.25), computes the equivalent temperature in degrees Celsius, and outputs the result in a dialog box.
Don't overwrite your files from last week's assignment. Create a new Eclipse project (in the same workspace), using the Eclipse Project Wizard (like last week). This time, name your package msoe.se1011.<yourname>, and name the class TemperatureConverter. Be sure to have the wizard automatically add a main method and comments that you can add to later.
You must write the Java instructions that implement the algorithm yourself. You can refer back to the program from the previous lab, but be careful about simply copying parts of that program. You should enter each instruction of this program manually in order to get a "feel" for the syntax and structure of the statements.
Study these requirements before implementing your program. This assignment requires you to construct a flowchart before you begin coding.
There are various ways user may have entered an invalid temperature (e.g. "a", or "-10_3" ), pressing "OK" with no input, or pressing Cancel (with or without input). Handling any of these conditions is beyond what you learned so far in this course, so you don't have to worry about it for now (maybe next week, though). It is OK if your program crashes in any of these cases.
where Tc is
the computed temperature in degrees Celsius
TF is the input temperature in degrees Fahrenheit
Test your program and make certain that it works correctly, both for valid and invalid inputs.
Test for the 4 cases above, as well as for 4 other values (pick some reasonable values). Add comments to the bottom of your java file, where you include these 8 results. Make sure your results are understandable to me, the reader.
Comment your program appropriately, as discussed in lecture. Be sure to add your name, date, and Lab assignment information at the top of the java file as a comment.
Remember: While you may discuss the concepts with your classmates, you must write your own program. You may not copy or borrow code from your classmates. If you do, you will be given a grade of 0 and reported to the office academic affairs.
Submit your assignment following these instructions:
Be sure to keep copies of all your java files, in case something gets lost.
Your grade will be based on the following criteria: