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
help required to write code
Page 1 of 16 Replies - 243 Views - Last Post: 06 January 2012 - 10:59 PM
Replies To: help required to write code
#2
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.
#3
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).
#4
Re: help required to write code
Posted 05 January 2012 - 08:37 PM
Just search this forum for fahrenheit
#5
Re: help required to write code
Posted 05 January 2012 - 08:46 PM
#6
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);
}
}
#7
Re: help required to write code
Posted 06 January 2012 - 10:59 PM
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote









|