ProtusMose.com

A slick and polished mess.


follow protusmose at http://twitter.com

Apr

05

It’s two things at once!

Posted by: mose

Posted in: Fantastic!

import javax.swing.JOptionPane;

public class FahrenheitToCelciusTwo {
public static void main(String[] args) {
//Prompt the user for input
String inputValueString = JOptionPane.showInputDialog(
null, “Please enter a temperature in Fahrenheit:”);

// Convert string to double
double inputValue =
Double.parseDouble(inputValueString);

// Calculate temperature in Celcius
double temperatureInCelcius =
(5.0 / 9) * (inputValue – 32);

// Display Results
String output = “The temperature in Celcius is ” + temperatureInCelcius;
JOptionPane.showMessageDialog(null, output);
}
}
********************

This program is both boring and awesome.

If you know programing, it’s probably readily apparent that this is a beginner’s work and you could probably think of 10 different ways to do it better.

If you don’t know programming, that’s pretty impressive, eh? The best part is, after two hours of tweaking, it works.

Finally.

Now I can go take a shower and go to bed.

Leave your comment


Fatal error: Uncaught Error: Call to undefined function ereg_replace() in /home/mose/public_html/protusmose/wp-content/themes/nightbird-news-10/footer.php(1) : eval()'d code:1 Stack trace: #0 /home/mose/public_html/protusmose/wp-content/themes/nightbird-news-10/footer.php(1): eval() #1 /home/mose/public_html/protusmose/wp-includes/template.php(688): require_once('/home/mose/publ...') #2 /home/mose/public_html/protusmose/wp-includes/template.php(647): load_template('/home/mose/publ...', true) #3 /home/mose/public_html/protusmose/wp-includes/general-template.php(76): locate_template(Array, true) #4 /home/mose/public_html/protusmose/wp-content/themes/nightbird-news-10/single.php(74): get_footer() #5 /home/mose/public_html/protusmose/wp-includes/template-loader.php(74): include('/home/mose/publ...') #6 /home/mose/public_html/protusmose/wp-blog-header.php(19): require_once('/home/mose/publ...') #7 /home/mose/public_html/protusmose/index.php(17): require('/home/mose/publ...') #8 {main} thrown in /home/mose/public_html/protusmose/wp-content/themes/nightbird-news-10/footer.php(1) : eval()'d code on line 1