I made this program as a project for one of my classes, and upon compiling it, I get this error:
Program09.java:21: error: method calculateCelsius in class Program09 cannot be applied to given types; double cTemp = calculateCelsius(); ^ required: int found: no arguments reason: actual and formal argument lists differ in length Program09.java:24: error: method calculateCelsius in class Program09 cannot be applied to given types; calculateCelsius(); ^ required: int found: no arguments reason: actual and formal argument lists differ in length Program09.java:25: error: method displayResults in class Program09 cannot be applied to given types; displayResults(); ^ required: int,double found: no arguments reason: actual and formal argument lists differ in length 3 errors
This is the program below. Any help would be greatly appreciated!
import java.util.Scanner;
public class Program09
{
public static void main(String[] args)
{
int fTemp = getFarenheit();
double cTemp = calculateCelsius();
displayInstructions();
getFarenheit();
calculateCelsius();
displayResults();
}
public static void displayInstructions()
{
System.out.println("This program will convert farenheit to celsius");
System.out.println("after you enter a farenheit temperature");
}
public static int getFarenheit()
{
System.out.println("Please enter your temperature below");
Scanner keyboard = new Scanner(System.in);
return keyboard.nextInt();
}
public static double calculateCelsius(int farenheit)
{
return (5 * (farenheit - 32) / 9.0);
}
public static void displayResults(int fTemp, double cTemp)
{
System.out.println("Your farenheit temperature is " + fTemp);
System.out.printf("Your celsius temperature is ", + cTemp);
System.out.println("Thank you for using the program!");
System.out.println("The rest of the world needs to conform to imperial measurments, cuz 'merica");
return;
}
}