Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. public class Sonia{
  2.  
  3. public static void main(String args[]){
  4. /*String response = nametagText("sonia");
  5. System.out.println(response);*/
  6. double t = fahrenheitToCelsius(212);
  7. System.out.println(t);
  8. printTemperature(212);
  9. }
  10.  
  11. public static String nametagText(String name){
  12. String text = "Hello, my name is "+name;
  13. return text;
  14. }
  15.  
  16. public static double fahrenheitToCelsius(double temp){
  17. return (temp-32)*5/9;
  18. }
  19.  
  20. public static void printTemperature(double temp2){
  21. String f = "F: " +temp2;
  22. String c = "C: " +fahrenheitToCelsius(temp2);
  23. System.out.println(f);
  24. System.out.println(c);
  25. }
  26.  
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement