Skip to content

About

OOP Project Second Semester

Resources

Stars

13 stars

Watchers

0 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

Repository files navigation

Temperature Converter

A Java Swing application for converting temperatures between Celsius, Fahrenheit, and Kelvin. The project demonstrates object-oriented programming concepts including interfaces, encapsulation, inheritance, and polymorphism.

Supported conversions

From To
Celsius Fahrenheit, Kelvin
Fahrenheit Celsius, Kelvin
Kelvin Celsius, Fahrenheit
Any supported unit The same unit

The application rejects values below absolute zero:

  • Celsius: -273.15 °C
  • Fahrenheit: -459.67 °F
  • Kelvin: 0 K

Project structure

The Java sources use the com.tempconverter package:

  • TemperatureConverterGUI.java — Swing user interface and input validation.
  • TemperatureConverter.java — Selects and runs the appropriate conversion.
  • Convertible.java — Common conversion interface.
  • CelsiusToFahrenheit.java, FahrenheitToCelsius.java — Celsius/Fahrenheit conversions.
  • CelsiusToKelvin.java, KelvinToCelsius.java — Celsius/Kelvin conversions.

Compiled .class files are generated artifacts and are not required to run the project from source.

Requirements

  • Java Development Kit (JDK) 8 or newer.
  • A graphical desktop environment for the Swing interface.

Compile and run

From the repository root, compile the package sources into a separate output directory:

mkdir -p out
javac -d out *.java
java -cp out com.tempconverter.TemperatureConverterGUI

On Windows PowerShell, the equivalent commands are:

New-Item -ItemType Directory -Force out
javac -d out *.java
java -cp out com.tempconverter.TemperatureConverterGUI

Usage

  1. Enter a numeric temperature.
  2. Select the input unit.
  3. Select the output unit.
  4. Click Convert.

Invalid numbers and physically impossible temperatures are reported before conversion.

License

This project is licensed under the MIT License. See LICENSE for details.

About

OOP Project Second Semester

Resources

Stars

13 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages