Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Sonia{
- public static void main(String args[]){
- /*String response = nametagText("sonia");
- System.out.println(response);*/
- double t = fahrenheitToCelsius(212);
- System.out.println(t);
- printTemperature(212);
- }
- public static String nametagText(String name){
- String text = "Hello, my name is "+name;
- return text;
- }
- public static double fahrenheitToCelsius(double temp){
- return (temp-32)*5/9;
- }
- public static void printTemperature(double temp2){
- String f = "F: " +temp2;
- String c = "C: " +fahrenheitToCelsius(temp2);
- System.out.println(f);
- System.out.println(c);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement