6 Replies - 324 Views - Last Post: 06 January 2012 - 10:59 PM Rate Topic: -----

#1 billyboynw71hs  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 21-December 11

help required to write code

Posted 05 January 2012 - 02:54 PM

dear Members,
Yet another assignment, i have to write a progarm that gives temperature in either celcius and fahrenheight to suit the person making the request, obviously there is a lot of maths inolved but any ideas where i can find a tutorial or help getting started.
Thanks
Billy
Is This A Good Question/Topic? 0
  • +

Replies To: help required to write code

#2 macosxnerd101  Icon User is offline

  • Self-Trained Economist
  • member icon




Reputation: 10390
  • View blog
  • Posts: 38,455
  • Joined: 27-December 08

Re: help required to write code

Posted 05 January 2012 - 02:57 PM

Quote

obviously there is a lot of maths inolved

Not really. More like simple algebra and formulas. There really isn't much help we can give you until you put in some effort beyond the formulas, which you can find on Google.
Was This Post Helpful? 1
  • +
  • -

#3 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 8939
  • View blog
  • Posts: 33,521
  • Joined: 12-June 08

Re: help required to write code

Posted 05 January 2012 - 02:58 PM

There's a ton of stuff when you bing "convert celsius to fahrenheit" (or vise versa).
Was This Post Helpful? 0
  • +
  • -

#4 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8324
  • View blog
  • Posts: 31,857
  • Joined: 06-March 08

Re: help required to write code

Posted 05 January 2012 - 08:37 PM

Just search this forum for fahrenheit
Was This Post Helpful? 0
  • +
  • -

#5 DimitriV  Icon User is offline

  • They don't think it be like it is, but it do
  • member icon

Reputation: 583
  • View blog
  • Posts: 2,738
  • Joined: 24-July 11

Re: help required to write code

Posted 05 January 2012 - 08:46 PM

I use this site:
http://www.csgnetwor...mpconvjava.html
Was This Post Helpful? 0
  • +
  • -

#6 hani.itani  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 01-January 12

Re: help required to write code

Posted 06 January 2012 - 04:07 PM

have a look at this:


import java.util.Scanner;

public class TempConverter2
{
   //-----------------------------------------------------------------
   //  Computes the Celsius equivalent of a Fahrenheit value read
   //  from the user. Uses the formula C = (5/9)(F - 32).
   //-----------------------------------------------------------------
   public static void main (String[] args)
   {
      final int BASE = 32;
      final double CONVERSION_FACTOR = 5.0 / 9.0;

      double celsiusTemp, fahrenheitTemp;
	  Scanner scan = new Scanner(System.in);

      System.out.print ("Enter a Fahrenheit temperature: ");
      fahrenheitTemp = scan.nextDouble();

      celsiusTemp = CONVERSION_FACTOR * (fahrenheitTemp - BASE);

      System.out.println ("Celsius Equivalent: " + celsiusTemp);
   }
}


Was This Post Helpful? 0
  • +
  • -

#7 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8324
  • View blog
  • Posts: 31,857
  • Joined: 06-March 08

Re: help required to write code

Posted 06 January 2012 - 10:59 PM

View Posthani.itani, on 06 January 2012 - 06:07 PM, said:

have a look at this:

And ?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1