I am in a Intro to java class and we were instructed to create a weather app. When ever I compile the code, I get three errors. Keep in mind we are using Git BASH to compile the code, and sublime text to write it. We are not allowed to use any IDE like Eclipse.
Errors:
$ javac src/com/bradywemette/weatherapp/WeatherApp.java
src\com\bradywemette\weatherapp\WeatherApp.java:3: error: package com.bradywemette.converters does not exist
import com.bradywemette.converters.TemperatureConverter;
^
src\com\bradywemette\weatherapp\WeatherApp.java:10: error: cannot find symbol
TemperatureConvertor tc = new TemperatureConvertor();
^
symbol: class TemperatureConvertor
location: class WeatherApp
src\com\bradywemette\weatherapp\WeatherApp.java:10: error: cannot find symbol
TemperatureConvertor tc = new TemperatureConvertor();
^
symbol: class TemperatureConvertor
location: class WeatherApp
3 errors
WeatherApp.java Code:
package com.bradywemette.weatherapp;
import com.bradywemette.converters.TemperatureConverter;
import java.util.Scanner;
public class WeatherApp {
public static void main(String[] args){
TemperatureConvertor tc = new TemperatureConvertor();
Scanner keyboard = new Scanner(System.in);
System.out.println("Enter a temperature in celsius");
int tempCelsius = keyboard.nextInt();
float tempFahrenheit = tc.celsiusToFarhenheit((float)tempCelsius);
System.out.println(tempCelsius + " is" + tempFahrenheit + " fahrenheit");
}
}
Temperatureconverter.java Code:
package com.bradywemette.converters;
public class TemperatureConverter{
public float celsiusToFarhenheit(float celsius){
float fahrenheit = celsius * (9f/5f) + 32;
return fahrenheit;
}
}
Any help is appreciated.