Skip to main content
Became Hot Network Question
Tweeted twitter.com/StackCodeReview/status/1277572530740637696
deleted 3 characters in body
Source Link
user226918
user226918

I have made a program that converts Celsius to Fahrenheit and Fahrenheit to Celsius. How is my code?

import java.util.Scanner;
public class TemperatureConversion {
    public static void main(String[] args) {
        double fahrenheit, celsius;
        Scanner input = new Scanner(System.in);
        //  Celsius to Fahrenheit \u2103 degree Celsius symbol
        System.out.println("Input temperature (\u2103): ");
        celsius = input.nextDouble();
        System.out.println(celsius * 1.8 + 32 + " \u2109 \n");

        // Fahrenheit to Celsius \u2109 degree Fahrenheit symbol
        System.out.println("Input temperature (\u2109: ");
        fahrenheit = input.nextDouble();
        System.out.print((fahrenheit - 32) / 1.80008 + " \u2103");
    }
}

I have made a program that converts Celsius to Fahrenheit and Fahrenheit to Celsius. How is my code?

import java.util.Scanner;
public class TemperatureConversion {
    public static void main(String[] args) {
        double fahrenheit, celsius;
        Scanner input = new Scanner(System.in);
        //  Celsius to Fahrenheit \u2103 degree Celsius symbol
        System.out.println("Input temperature (\u2103): ");
        celsius = input.nextDouble();
        System.out.println(celsius * 1.8 + 32 + " \u2109 \n");

        // Fahrenheit to Celsius \u2109 degree Fahrenheit symbol
        System.out.println("Input temperature (\u2109: ");
        fahrenheit = input.nextDouble();
        System.out.print((fahrenheit - 32) / 1.8000 + " \u2103");
    }
}

I have made a program that converts Celsius to Fahrenheit and Fahrenheit to Celsius. How is my code?

import java.util.Scanner;
public class TemperatureConversion {
    public static void main(String[] args) {
        double fahrenheit, celsius;
        Scanner input = new Scanner(System.in);
        //  Celsius to Fahrenheit \u2103 degree Celsius symbol
        System.out.println("Input temperature (\u2103): ");
        celsius = input.nextDouble();
        System.out.println(celsius * 1.8 + 32 + " \u2109 \n");

        // Fahrenheit to Celsius \u2109 degree Fahrenheit symbol
        System.out.println("Input temperature (\u2109: ");
        fahrenheit = input.nextDouble();
        System.out.print((fahrenheit - 32) / 1.8 + " \u2103");
    }
}
deleted 33 characters in body
Source Link
Peilonrayz
  • 44.6k
  • 7
  • 80
  • 158

I have made a program that would convertconverts Celsius to Fahrenheit and Fahrenheit, and it worked. And I wanted to ask you guys, how wasCelsius. How is my code?

import java.util.Scanner;
public class TemperatureConversion {
    public static void main(String[] args) {
        double fahrenheit, celsius;
        Scanner input = new Scanner(System.in);
        //  Celsius to Fahrenheit \u2103 degree Celsius symbol
        System.out.println("Input temperature (\u2103): ");
        celsius = input.nextDouble();
        System.out.println(celsius * 1.8 + 32 + " \u2109 \n");

        // Fahrenheit to Celsius \u2109 degree Fahrenheit symbol
        System.out.println("Input temperature (\u2109: ");
        fahrenheit = input.nextDouble();
        System.out.print((fahrenheit - 32) / 1.8000 + " \u2103");
    }
}
```

I made a program that would convert Celsius to Fahrenheit and Fahrenheit, and it worked. And I wanted to ask you guys, how was my code?

import java.util.Scanner;
public class TemperatureConversion {
    public static void main(String[] args) {
        double fahrenheit, celsius;
        Scanner input = new Scanner(System.in);
        //  Celsius to Fahrenheit \u2103 degree Celsius symbol
        System.out.println("Input temperature (\u2103): ");
        celsius = input.nextDouble();
        System.out.println(celsius * 1.8 + 32 + " \u2109 \n");

        // Fahrenheit to Celsius \u2109 degree Fahrenheit symbol
        System.out.println("Input temperature (\u2109: ");
        fahrenheit = input.nextDouble();
        System.out.print((fahrenheit - 32) / 1.8000 + " \u2103");
    }
}
```

I have made a program that converts Celsius to Fahrenheit and Fahrenheit to Celsius. How is my code?

import java.util.Scanner;
public class TemperatureConversion {
    public static void main(String[] args) {
        double fahrenheit, celsius;
        Scanner input = new Scanner(System.in);
        //  Celsius to Fahrenheit \u2103 degree Celsius symbol
        System.out.println("Input temperature (\u2103): ");
        celsius = input.nextDouble();
        System.out.println(celsius * 1.8 + 32 + " \u2109 \n");

        // Fahrenheit to Celsius \u2109 degree Fahrenheit symbol
        System.out.println("Input temperature (\u2109: ");
        fahrenheit = input.nextDouble();
        System.out.print((fahrenheit - 32) / 1.8000 + " \u2103");
    }
}
Source Link
user226918
user226918

Java Temperature Converter

I made a program that would convert Celsius to Fahrenheit and Fahrenheit, and it worked. And I wanted to ask you guys, how was my code?

import java.util.Scanner;
public class TemperatureConversion {
    public static void main(String[] args) {
        double fahrenheit, celsius;
        Scanner input = new Scanner(System.in);
        //  Celsius to Fahrenheit \u2103 degree Celsius symbol
        System.out.println("Input temperature (\u2103): ");
        celsius = input.nextDouble();
        System.out.println(celsius * 1.8 + 32 + " \u2109 \n");

        // Fahrenheit to Celsius \u2109 degree Fahrenheit symbol
        System.out.println("Input temperature (\u2109: ");
        fahrenheit = input.nextDouble();
        System.out.print((fahrenheit - 32) / 1.8000 + " \u2103");
    }
}
```