Results 1 to 4 of 4
- 03-03-2010, 03:55 AM #1
Member
- Join Date
- Mar 2010
- Posts
- 2
- Rep Power
- 0
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
- 03-03-2010, 04:23 AM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
- 03-03-2010, 04:28 AM #3
Member
- Join Date
- Mar 2010
- Posts
- 2
- Rep Power
- 0
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.
- 03-03-2010, 04:34 AM #4
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
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
-
Help with fahrenheit to celsius conversion
By java_is_killingme in forum New To JavaReplies: 4Last Post: 03-07-2009, 11:11 AM -
Fahrenheit to celsius
By lalithalydia in forum New To JavaReplies: 3Last Post: 02-05-2008, 07:50 AM -
farenheit to celsius
By lalithalydia in forum New To JavaReplies: 2Last Post: 02-02-2008, 08:44 AM -
Celsius Converter project
By jpdamigaman in forum NetBeansReplies: 3Last Post: 11-14-2007, 12:20 AM -
Converts from Fahrenheit to Celsius
By trill in forum New To JavaReplies: 1Last Post: 08-06-2007, 05:52 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks