User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 427,989 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,515 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Sep 20th, 2004
Views: 15,505
This program consists of one function in one class. It uses MyInput.java to demonstrate how primitive data types are implemented in Java.
java Syntax | 3 stars
  1. package farenheittocelcius;
  2. public class FarenheitToCelcius {
  3. public static void main(String args[])
  4. {
  5. double farenheit, celcius = 0;
  6. System.out.println("\n\tPlease enter temp. in farenheit: ");
  7. farenheit = MyInput.readDouble();
  8. celcius = (5/9)*(farenheit-32);
  9. System.out.println("\n\tThat is " + celcius + " degrees celcius.");
  10. }
  11. }
Comments (Newest First)
Eddi | Newbie Poster | Sep 20th, 2004
Hi Dani,
fine Examples (the others too) to learn programming Java, but where is the MyInput.java class?

Thanks
Eddi
Montrell274 | Newbie Poster | Sep 20th, 2004
I had to do this same program for a homework assignment, except we had to do celcius to fahrenheit.
Post Comment

Only community members can submit or comment on code snippets. You must register or log in to contribute.

DaniWeb Marketplace (Sponsored Links)
All times are GMT -4. The time now is 9:40 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC