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: Problem on displaying Celcius

  1. #1
    Junior Member
    Join Date
    Jan 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post Problem on displaying Celcius

    Hello,

    For a class project I have to make a program, witch it gets the temperature (fahrenheit) in 5 different Station and after I have to compute the mean temperature, check the hightest/lowest. Until here I did all without problems, but i have to display the result in fahrenheit and celcius and I have trouble to get the right visualization in celcius. Can someone give me some tips ?

    I'm gonna past just part of my code but I think that's enough

     for(Index = 0 ; Index < Station ; Index++)
          {
             System.out.print("Enter Station Temperature: ");
             List[Index] = Input.nextDouble();
             Total += List[Index]; // Adding all the temperature
             }
     
          Celcius = (5 * (List[0] - 32) / 9); // Convert temperature to Celcius  
          Mean = Total/Station; // Calculate the mean temperature
     
          for(Index = 0 ; Index < Station ; Index++)
          {
             if(List[Index] > Hightest)
     
                Hightest = List[Index];
     
             if(List[Index] < Lowest);
     
             Lowest = List[Index];
          }

    Thanks in advance for any suggestions


  2. #2
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 287 Times in 225 Posts
    Blog Entries
    4

    Default Re: Problem on displaying Celcius

    Hello Superteo1987.

    Welcome to the Java Programming Forums.

    Ideally, you will need to post something we can compile. I can see what you are trying to do though.
    I would take this one step at a time to get each part working on it's own.

    I would start with getting the temperatures added to the List array correctly.
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

    Looking for a Java job? Visit - Java Programming Careers

Similar Threads

  1. displaying multiple jpanels in a jframe
    By tooktook22 in forum AWT / Java Swing
    Replies: 1
    Last Post: January 19th, 2011, 01:46 PM
  2. Not Displaying what I need
    By rob3097 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: November 7th, 2010, 10:31 PM
  3. Applet Help: Parsing and displaying labels
    By katyprim in forum What's Wrong With My Code?
    Replies: 6
    Last Post: September 11th, 2010, 10:32 AM
  4. Displaying things in gui
    By KrisTheSavage in forum AWT / Java Swing
    Replies: 2
    Last Post: March 29th, 2010, 01:21 PM
  5. [SOLVED] displaying sum of harmonic series
    By sriraj.kundan in forum Algorithms & Recursion
    Replies: 2
    Last Post: June 16th, 2009, 12:42 AM