Ok i need to create a java program that repeatedly read temperatures in Fahrenheit and convert them to Celsius until a temperature > 212 F (the boiling point of water) is entered.
My program is:
[CODE=java]
import java.util.*;
// Converter.java
public class Converter
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System. in);
System.out.prin t("Enter temp: ");
int temp = sc.nextInt();
System.out.prin tln(convertToC( temp));
}
public static int convertToC(int temp)
{
return ((temp - 32 ) * 5/9);
}
}
[/CODE]
I would really appreaciate it. Thank you. <email removed>
My program is:
[CODE=java]
import java.util.*;
// Converter.java
public class Converter
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System. in);
System.out.prin t("Enter temp: ");
int temp = sc.nextInt();
System.out.prin tln(convertToC( temp));
}
public static int convertToC(int temp)
{
return ((temp - 32 ) * 5/9);
}
}
[/CODE]
I would really appreaciate it. Thank you. <email removed>
Comment