Hey, I'm back with some more questions. This part in the course I'm taking is quite confusing because the pages I had to read to learn about constructors literally began to talk about cats, dogs, rabbits and assorted other animals in the code and it totally threw me off so I'm hoping some of the people here could help me figure out constructors and how to work with them a little bit better.
For my current assignment I'm writing up a little program that uses a constructor and two methods that I'd call to convert between celsius and fahrenheit. I've written up most of what I think I need for the program to work but I'm confident that there are a lot of errors and mistakes in the program. I'd like if someone could look over it and maybe explain what I'm doing wrong and how it should be done etc...
There are a few things I haven't yet added into the program, I think all I forgot was the thing that calls one or the other method in the Assignment9Question2 class.import java.io.*;//tells Java input will be used class Assignment9Question2 { //constructor with 3 parameters to initialize the variables Assignment9Question2(double celsiusTemp, double farenheitTemp) { System.out.println("Nothing here yet!"); } public void convertToCelcius(double farenheitTempEnt) { //Conversion of temperature and output of the resulting infomration.' double celsiusTemp = (5.0 / 9.0) * (farenheitTempEnt - 32); System.out.println(""); } public void convertToFarenheit(double celsiusTempEnt) { //Conversion of temperature and output of the resulting infomration. double farenheitTemp = (9.0 / 5.0) * (celsiusTempEnt + 32); System.out.println(""+celsiusTempEnt+" would be "+farenheitTemp+" in farenheit."); } } // Test Class class Assignment9Question1Tester { public static void main (String[] args) throws IOException { InputStreamReader inStream = new InputStreamReader (System.in); BufferedReader userInput = new BufferedReader (inStream); String inData; double celsiusTempEnt = 0.0, farenheitTempEnt = 0.0; //Declares two double variables System.out.println ("Enter a temperature in farenheit:"); //asks for user input inData = userInput.readLine ( ); //places input into inData variable farenheitTempEnt = Double.parseDouble(inData); //converts string to double and places into a double variable System.out.println ("Enter a temperature in celsius:"); inData = userInput.readLine ( ); //places input into inData variable celsiusTempEnt = Double.parseDouble(inData); //converts string to double and places into a double variable Assignment9Question2 = new Assignment9Question2("+celsiusTempEnt+", "+farenheitTempEnt+"); } }