Login Register


Convert to Celsius using Methods filter_list
Author
Message
RE: Convert to Celsius using Methods #3
i think that's what u've asked for:
Code:
package conversiontable; public class Conversiontable { public static int convert(int c) { int f = (c * 9 / 5) + 32; return f; } public static void main(String[] args) { System.out.println("The following is a table that converts Celsius to Fahrenheit:"); System.out.println("Celsius Fahrenheit"); for (int c = 0; c <= 20; c = c + 1) { System.out.println(c + " " + convert(c)); } } }

Reply





Messages In This Thread



Users browsing this thread: 1 Guest(s)