galinyotsev123

ProgBasics02Simple-Operations-P08CelsiusToFahrenheit

Jan 12th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class P08CelsiusToFahrenheit {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. double celsius = Double.parseDouble(scanner.nextLine());
  8. double Fahrenheit = celsius * 1.8 + 32;
  9.  
  10. System.out.printf("%.2f", Fahrenheit);
  11. }
  12. }
  13.  
  14.  
  15. //a tova e moeto reshenie
  16.  
  17. //import java.util.Scanner;
  18.  
  19. //public class P08CelsiusToFahrenheit {
  20. // public static void main (String[] args) {
  21. // Scanner scanner = new Scanner(System.in);
  22.  
  23. // double celsius = Double.parseDouble(scanner.nextLine());
  24. // double Fahrenheit = (celsius * 1.8) + 32;
  25. // double fahrenheit = Math.floor(celsius);
  26.  
  27. // System.out.println(Fahrenheit);
  28. // }
  29. // }
Advertisement
Add Comment
Please, Sign In to add comment