Package com.project

Class TempConverter

java.lang.Object
com.project.TempConverter

public class TempConverter extends Object
Temperature Converter Application.

This program provides a console-based temperature conversion utility with the following functionalities:

  • Convert Celsius to Fahrenheit
  • Convert Fahrenheit to Celsius
  • Exit the program
The program uses jfiglet to display a banner in ASCII art.
Since:
2025-02-24
Version:
1.0.0
Author:
Anurag Zete
  • Constructor Details

    • TempConverter

      public TempConverter()
      Default constructor for the TempConverter class.

      This constructor is automatically invoked when creating an instance of the class.

  • Method Details

    • main

      public static void main(String[] args)
      The main entry point for the temperature converter program.

      It displays a banner, provides a menu for the user to select conversion operations, and handles invalid inputs gracefully.

      Parameters:
      args - Command-line arguments (not used).
    • celsiusToFahrenheit

      private static double celsiusToFahrenheit(double celsius)
      Converts temperature from Celsius to Fahrenheit.
      Parameters:
      celsius - The temperature in Celsius.
      Returns:
      The equivalent temperature in Fahrenheit.
    • fahrenheitToCelsius

      private static double fahrenheitToCelsius(double fahrenheit)
      Converts temperature from Fahrenheit to Celsius.
      Parameters:
      fahrenheit - The temperature in Fahrenheit.
      Returns:
      The equivalent temperature in Celsius.