answersLogoWhite

0


Best Answer

degreesFahrenheit = degreesCelsius * 9 / 5 + 32;

degreesFahrenheit = degreesCelsius * 9 / 5 + 32;

degreesFahrenheit = degreesCelsius * 9 / 5 + 32;

degreesFahrenheit = degreesCelsius * 9 / 5 + 32;

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

import java.util.*;

class Convert

{

public static void main(String args[])

{

Scanner s=new Scanner(System.in);

System.out.println("Enter the Fahrenheit temperature");

int f=s.nextInt();

int c=((f-32)5)/9;

System.out.println("the degrees in celsius is"+c);

}

}

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

import java.util.Scanner;

public class ConvertTemperature {

public static void main(String... args) {

int choice;

int temp;

System.out.println("Type 1 to convert from Celsius to Fahrenheit");

System.out.println("Type 2 to convert from Fahrenheit to Celsius");

Scanner in = new Scanner(System.in);

choice = in.nextInt();

switch (choice) {

case 1:

System.out.println("Please input degrees in Celsius.");

temp = in.nextInt();

System.out.println(temp + " degress Celsius is equal to " + celsiusToFahrenheit(temp) + " degrees Fahrenheit");

in.close();

break;

case 2:

System.out.println("Please input degrees in Fahrenheit.");

temp = in.nextInt();

System.out.println(temp + " degress Fahrenheit is equal to " + fahrenheitToCelsius(temp) + " degrees Celsius");

in.close();

break;

default:

in.close();

System.out.println("No convertion choosen. Exiting now.");

}

System.exit(0);

}

public static double celsiusToFahrenheit (double t) {

return t * 9 / 5 + 32;

}

public static double fahrenheitToCelsius (double t) {

return (t - 32) * 5 / 9;

}

}

This answer is:
User Avatar

User Avatar

Wiki User

10y ago

import java.util.*; //Import to allow you to get user input

public class Conversion

{

public static void main(String[] args)

{

Scanner in = new Scanner(System.in); //Creates scanner object, requires java.util.Scanner

System.out.println("Would you like to convert from Fahrenheit to Celcius or Celcius to Fahrenheit?");

System.out.println("(1) Fahrenheit to Celcius");

System.out.println("(2) Celcius to Fahrenheit");

int choice = in.nextInt(); //Get user input on whether to do F to C or C to F

if (choice != 1 && choice != 2)

{

System.out.println("That was not one of the choices."); //handle if they don't enter a valid choice.

}

else if (choice 2)

{

System.out.println("Please enter the temperature in Celcius to be converted to Fahrenheit:");

double toConvertCelcius = in.nextDouble();

toConvertCelcius = (((toConvertCelcius*9)/5)+32); //multiply by 9, divide by 5, add 32.

System.out.println("Your converted value is: " + toConvertCelcius + " degrees Fahrenheit.");

}

}

}

This answer is:
User Avatar

User Avatar

Wiki User

8y ago

#include<stdio.h>

void main()

{

float c,f;

printf("Enter the temperature in Fahrenheit\n");

scanf("%d",&f);

c=(5*f)/9-32;

printf("The temperature %d in Fahrenheit=%f in celsius\n",f,c);

printf("-------------THANK YOU-----------------------");

}

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

Here is the code for such a program with a class name "Example":

import java.util.*;

public class Example

{

public static void main(String[] args)

{

Scanner in = new Scanner(System.in);

System.out.println("What Fahrenheit temperature would you like converted to Celsius?");

double d = in.nextDouble();

double converted = d-32;

converted = converted*5;

converted = converted/9;

System.out.println("Your converted value is: " + converted + " degrees Celcius.");

}

}

We are not allowed to put links in Answers to questions, so I have now put the link to the explanation of this code in the related links section.

This answer is:
User Avatar

User Avatar

Wiki User

15y ago

public static final double fToC(final double degreesF) {

return ((degreesF - 32.0) * 5.0) / 9.0;

}

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

double Fahrenheit = 100.0; // Just an exampledouble centigrade = (Fahrenheit - 32) * 5 / 9;System.out.println("The temperature in centigrade is " + centigrade);

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

Include the following in your main() program: float centigrade = 0.0F;float Fahrenheit = centigrade * 9 / 5 + 32;

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

degreesFahrenheit = degreesCelsius * 9 / 5 + 32;

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the Fahrenheit to Celsius program in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Celsius and Fahrenheit equivalents?

0o Celsius is 32o Fahrenheit. 100o Celsius is 212o Fahrenheit.


How would you design a flowchart to convert Fahrenheit to Celsius and Celsius to Fahrenheit?

input fahrenheit celsius = (fahrenheit - 32) * 1.8 write celsius Flow chart


How do make Celsius to Fahrenheit?

The formula to convert Celsius to Fahrenheit is:(Celsius x 1.8) + 32 = Fahrenheit


What are the steps to converting Celsius to Fahrenheit?

(Celsius x 1.8)+32= Fahrenheit (Fahrenheit-32)/1.8= Celsius


What is 400degrees Fahrenheit in Celsius?

400 Fahrenheit = 204.4 Celsius 400 Celsius = 752 Fahrenheit


How do the two formulas Fahrenheit and Celsius derive?

Fahrenheit = (Celsius * 1.8) + 32 Celsius = (Fahrenheit - 32) / 1.8


When did Celsius and Fahrenheit originate?

Celsius: 1742 Fahrenheit: 1724


What is 147 Fahrenheit to Celsius?

147 Fahrenheit convert to Celsius


What is 108 Fahrenheit in Celsius?

108 Fahrenheit is 42.2 Celsius


What is body temperature in Celsius and Fahrenheit?

98.6 degrees in Fahrenheit 37 degrees in Celsius


What is 20 30 degrees celsius in Fahrenheit?

20 degrees Celsius = 68 degrees Fahrenheit 30 degrees Celsius = 86 degrees Fahrenheit.


Write JSP page use with java bean to convert Fahrenheit to Celsius and Celsius to Fahrenheit?

&lt;html&gt; &lt;head&gt; &lt;title&gt;Temperature Conversion&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;h1&gt;Temperature Conversion&lt;/h1&gt; &lt;p&gt;&lt;%=request.getParameter("fahr") %&gt; is &lt;%= (Double.parseDouble(request.getParameter("fahr")) - 32) * 5 / 9 %&gt; degrees celsius. &lt;/html&gt;