I am doing my first Java assignment and I'm struggling with an error here.
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ctof;
/**
*
* @author Braydon
*/
import java.util.Scanner;
public class CtoF {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
System.out.println("Enter temperature in Celsius:");
Scanner temp = new Scanner(System.in);
String T = scan.nextLine();
T = (T - 32) * 5/9;
System.out.println("Temperature in Fahrenheit =" + T);
}
}
The error it gives me is as follows.
run:
Enter temperature in Celsius:
Exception in thread "main" java.lang.UnsupportedOperationException: Not supported yet.
at ctof.scan.nextLine(scan.java:19)
at ctof.CtoF.main(CtoF.java:21)
Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)
The error is in the line where I perform the math, but I've tried everything and I can't seem to fix it. Please help!