CSCI102A Lab 2B Fall 2008 Semester ----------------------------------- Install Java and JCreator at home following the instructions on the course schedule in week 2 (Homework 1 link). Then try to complete the following: Write a program that allows the user to convert a temperature given in degrees from either Celcius to Fahrenheit or Fahrenheit to Celcius use the following formulas: DegreesC = 5 x (DegreesF - 32 ) /9 DegreesF = ( 9 x (DegreesC) / 5) + 32 Prompt the user to enter a temperature and either enter a C for Celcius or a F for Fahrenheit. Convert the temperature to Fahrenheit if C is entered or to Celcius if F is entered. e.g.: ************************************** Please enter a temperature value: 37.0 Please enter C for Celcius or F: C The temperature in the other scale is 98.6 ******************************************* Starter program save as Example.java): public class Example { public static void main(String[] args) { char temperatureScale; double temperature; double degreesF = 0.0; System.out.println("Enter a temperature value:"); temperature = SavitchIn.readLineDouble(); System.out.println("The temperature you entered is"); System.out.println(temperature); System.out.println("Enter a temperature scale (C or F):"); temperatureScale = SavitchIn.readChar(); System.out.println("The temperature scale you entered is"); System.out.println(temperatureScale); if (temperatureScale == 'C') degreesF = 9 * temperature / 5 + 32; System.out.println(degreesF); } }