View difference between Paste ID: X3048uA2 and xJR5mv2t
SHOW: | | - or go back to the newest paste.
1
import java.util.Scanner;
2
3
public class Converter {
4
5-
	@SuppressWarnings("null")
5+
6
		Scanner keyboard = new Scanner(System.in);
7
		
8
		System.out.println("Welcome to the Fahrenheit/Celsius Converter!");
9
		System.out.println("To convert, type in your temperature and the identify if you are using fahrenheit or celsius.");
10
		System.out.println("Example: 69F or 69C F = Fahrenheit C = Celsius");
11
		
12
		String temperature;
13-
		String temperature = null;
13+
14
		double answer , temp;
15
		
16
		temp = keyboard.nextDouble();
17
		
18
		if (temperature.contains("F")) {
19
			String StringVariable = null;
20
			StringVariable.replace(f , ' ');
21
			answer = temp - 30 / 2;
22
			System.out.println("Poof! The temperature is " + answer + "C");
23
		} else {
24
			System.out.println("You entered the temperature wrong!");
25
			
26
			
27
			}
28
	}
29
30
}