Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package celsiusfahrenheitmethodtable;
- /**
- *
- * @author StoneBoneThone
- */
- public class CelsiusFahrenheitMethodTable
- {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args)
- {
- //Call the getCelsius method here
- double theCelsius;
- theCelsius= getCelsius(fahrenheit);
- //Display the table header (MAY NOT GO HERE!!!!)
- System.out.println("Celsius Fahrenheit");
- System.out.println("---------------------------");
- System.out.printf("%f\t\t%.1f\n",celsius, fahrenheit);
- }
- public static double getCelsius (double fahrenheit) //This DOES need to accept fahrenheit
- {
- double celsius = 0;
- //This is the loop that will increment fahrenheit and establish it
- for (fahrenheit = 0; fahrenheit >= 20; fahrenheit ++)
- {
- //This is the equation for Celsius
- celsius = 0.5*(fahrenheit -32); //need to figure out where fahrenehti comes in main method
- }
- return fahrenheit; // figure out; might do with main method emptiness
- //May also need some sort of string for main method
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement