![]() ![]() ("The temperature in Celcius is " + c + " degrees. ![]() ("Please input temperature in fahrenheit:") method to convert fahrenheit to celcius How to create Temperature Converter app using Java Swings Fahrenheit to Celsius and vice versa Tuitions Tonight 4K subscribers Subscribe 5K views 2 years ago In this video, I will show you. ("The temperature in Fahrenheit is " + f + " degrees.") ("Please input temperature in celcius:") InputStreamReader inStream = new InputStreamReader (System.in) īufferedReader temp = new BufferedReader (inStream) Use the following formula to convert to Celsius: Celsius (5/9) (Fahrenheit - 32) getKelvin: Returns the value of the ftemp field converted to Kelvin. method to convert celcius to fahrenheit This is what I have so far, and keep in mind that this is pretty much my first attempt at OOP, so it probably looks like a mess. Youre trying to crowd all your code into main(), which is not good practise, even for a non-Object-oriented language. This helps to make the application more modular, maintainable, and easier to update. I'm trying to design a program that will get the user to input a temperature in either Fahrenheit or Celsius, then the program will determine what that temperature is in the other measurement.Ĭan anyone give me any tips on if I am even going in the right direction? Celsius to Fahrenheit: (C x 9/5) + 32 F Fahrenheit to Celsius: (F 32) x 5/9 C The application follows the Model-View-Controller (MVC) design pattern, which separates the data and business logic of the application from its user interface. I'm fairly new at Java, even newer at trying to understand OOP, so don't make fun of my lack of understanding, please.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |