daily pastebin goal
69%
SHARE
TWEET

Untitled

a guest Oct 22nd, 2018 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top