Design of an Application

Classic programmed-learning exercises, refreshed for modern Java and presented in the current MrStyner.com portfolio style.

Modern Java noteThis archive has been refreshed for Java 25 LTS. Core language concepts remain useful, while outdated setup instructions and browser-era Java are labeled or replaced. Java 26 is the current feature release; Java 25 is used here as the stable teaching baseline.
go to previous page   go to home page   go to next page

Answer:

Boiling temperature is 212o Fahrenheit; 100o in Celsius.

Design of an Application

Let's design and implement a GUI application that converts a temperature expressed in Fahrenheit into Celsius. As usual, there are three parts to the design:

  1. The Graphical User Interface.
  2. Listener methods.
  3. Application methods.

Let us first look at the application methods. The formula for converting fahrenheit into Celsius is this:

celsius = (fahrenheit - 32) * 5/9

This is algebra, not Java. Although the algebra looks much like Java, some design decisions are needed.

QUESTION 2:

Should you use integer variables or floating point variables to implement the formula?