Results 1 to 4 of 4
  1. #1
    andrewsx is offline Member
    Join Date
    Mar 2010
    Posts
    2
    Rep Power
    0

    Default celsius to farenheit conversion program...

    I have to write the following program for a homework problem for class.

    Celsius.java Write a program to display the Celsius to Fahrenheit conversions. Your output should be displayed in three sets of columns similar to the display below.

    Celsius Farenheit
    10 50
    11 51.8
    12 53.6
    13 55.4


    (etc....basically I need to show three columns 1st column displaying 1-19 degrees celsius and its farenheit, 2nd column displaying 20-29 degrees C and its F and 3rd column displaying 30-39 degrees C and its F)


    so far in JGrasp I have entered this part of the program.

    public class celsius{
    public double convertCtoF(double degreesCelsius) {
    return degreesCelsius / 5.0 * 9.0 + 32.0;

    where I am getting hung up is what and how to enter into the program in order to display the result as stated above.

    Any help would be greatly appreciated as I am at work trying to do this.

    Thanks, Andrew

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

  3. #3
    andrewsx is offline Member
    Join Date
    Mar 2010
    Posts
    2
    Rep Power
    0

    Default

    What I have gotten so far I have run.

    this is what i get


    ----jGRASP exec: java celsius

    java.lang.NoSuchMethodError: main
    Exception in thread "main"
    ----jGRASP wedge2: exit code for process is 1.
    ----jGRASP: operation complete.

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Yes you didn't define the main method in your code, which is the entry point of the code. Can you show your complete code here?

    Hope you know how to write main method and stuff in Java

Similar Threads

  1. Help with fahrenheit to celsius conversion
    By java_is_killingme in forum New To Java
    Replies: 4
    Last Post: 03-07-2009, 11:11 AM
  2. Fahrenheit to celsius
    By lalithalydia in forum New To Java
    Replies: 3
    Last Post: 02-05-2008, 07:50 AM
  3. farenheit to celsius
    By lalithalydia in forum New To Java
    Replies: 2
    Last Post: 02-02-2008, 08:44 AM
  4. Celsius Converter project
    By jpdamigaman in forum NetBeans
    Replies: 3
    Last Post: 11-14-2007, 12:20 AM
  5. Converts from Fahrenheit to Celsius
    By trill in forum New To Java
    Replies: 1
    Last Post: 08-06-2007, 05:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •