Advertisement
JackHoughton00

TempConverter

Feb 22nd, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. package tempconverter;
  2. import java.util.Scanner;
  3.  
  4.  
  5. public class TempConverter {
  6.  
  7.  
  8. public static void main(String[] args) {
  9. Scanner input = new Scanner(System.in);
  10. System.out.print("Please input the temperature in fahrenheit:");
  11. int fahrenheit,celcius,precelcius =0;
  12. fahrenheit=input.nextInt();
  13. precelcius = (fahrenheit-32);
  14. celcius = (int) (precelcius*0.555);
  15. System.out.print("The temperature today in degrees celcius is "+celcius);
  16.  
  17.  
  18.  
  19.  
  20.  
  21. }
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement