Package com.project
Class TempConverter
java.lang.Object
com.project.TempConverter
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
jfiglet
to display a banner in ASCII art.- Since:
- 2025-02-24
- Version:
- 1.0.0
- Author:
- Anurag Zete
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static double
celsiusToFahrenheit
(double celsius) Converts temperature from Celsius to Fahrenheit.private static double
fahrenheitToCelsius
(double fahrenheit) Converts temperature from Fahrenheit to Celsius.static void
The main entry point for the temperature converter program.
-
Constructor Details
-
TempConverter
public TempConverter()Default constructor for theTempConverter
class.This constructor is automatically invoked when creating an instance of the class.
-
-
Method Details
-
main
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.
-