Last active
April 2, 2019 00:02
-
-
Save isauravmanitripathi/cbd4981a9708c00256a0b38c9221b6b9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class weather { | |
| public static void main(String [] args) { | |
| float fah = 86; | |
| System.out.println(fah + "Degrees Fahrenheit is..."); | |
| // TO convert Fahrenheit into celsius | |
| //Begin by subtracting 32 | |
| fah = fah - 32; | |
| // divide the answer by 9 | |
| fah = fah / 9; | |
| //Multiply that answer by 5 | |
| fah = fah * 5; | |
| System.out.println(fah + "degrees celsius\n"); | |
| float cel = 33; | |
| System.out.println(cel + "Degrees celsius is...."); | |
| // To convert Fahrenheit into Celsius | |
| // Begin by subtracting 32 | |
| cel = cel * 9 ; | |
| // divide the answer by 9 | |
| cel = cel / 5; | |
| //multiply that answer by 5 | |
| cel = cel + 32; | |
| System.out.println(cel + "Degrees Fahrenheit: "); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment