Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Hello there everyone!

  1. #1
    Junior Member
    Join Date
    Mar 2013
    Posts
    21
    My Mood
    Cool
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Hello there everyone!

    Write a class that contains the following two methods:

    /** Converts from Celsius to Fahrenheit */

    Hello there guys please I need help with this program in java
    this what i have done so far , please any help would much appreciated
    Thanks.


    public class EX5_8{
    public static void main(String args[]){
    public static double celsiusToFahrenheit(double celsius){
    return celsius=(5.0/9.0) * fahrenheit - 32;
    }
    public static double fahrenheitToCelsius(double fahrenheit){
    return fahrenheit=(9.0/5.0) * fahrenheit + 32;
    }
    System.out.println("|Celsius |Fahrenheit||Celsius |Fahrenheit| \n");
    for(double i=40,j=120 ;i<=31 && j<=-1.11;i-=1,j-=10){
    System.out.printf("%3.1f|%11.1f|%3.1f|%8.2f|\n",i, (i*(9.0/5)+32),j,j/i*(5.0/9)-32);


    Find below is the complete question

    public static double celsiusToFahrenheit(double celsius)

    /** Converts from Fahrenheit to Celsius */
    public static double fahrenheitToCelsius(double fahrenheit)

    The formula for the conversion is:

    fahrenheit = (9.0 / 5) * celsius + 32

    Write a test program that invokes these methods to display the following tables:
    Celsius Fahrenheit Fahrenheit Celsius
    40.0 104.0 120.0 48.89
    39.0 102.2 110.0 43.33
    ...
    32.0 89.6 40.0 4.44
    31.0 87.8 30.0 -1.11

  2. #2
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 262 Times in 231 Posts

    Default Re: Hello there everyone!

    Welcome fon90
    If you have a question please post it in an appropriate area, this is for saying hi.
    Also please not that posting homework instructions is not posting a question.

Tags for this Thread