import java.util.Scanner;
public interface ConversorTemperatura {
double celsiusParaFahrenheit(double celsius);
double fahrenheitParaCelsius(double fahrenheit);
}
class ConversorTemperaturaPadrao implements ConversorTemperatura {
@Override
public double celsiusParaFahrenheit(double celsius) {
return (celsius * 9/5) + 32;
}
@Override
public double fahrenheitParaCelsius(double fahrenheit) {
return (fahrenheit - 32) * 5/9;
}
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Digite a temperatura em Celsius: ");
double celsius = scanner.nextDouble();
ConversorTemperaturaPadrao conversor = new ConversorTemperaturaPadrao();
System.out.println(celsius + "°C em Fahrenheit: " + conversor.celsiusParaFahrenheit(celsius));
System.out.print("Digite a temperatura em Fahrenheit: ");
double fahrenheit = scanner.nextDouble();
System.out.println(fahrenheit + "°F em Celsius: " + conversor.fahrenheitParaCelsius(fahrenheit));
}
}