That code (with a Scanner declaration for kbinput, aqnd placed inside a method) compiles without any errors or warning in NetBeans, and gives the right answers when executed. Maybe the problem is not in that code but caused by something in the rest of the class? Read More
You have to `import java.util.Scanner;` to use the class name "Scanner" without fully-qualifying the name.
The constant 9.0 is a double value (that's how the language is defined), so the calculation is done in double, with a theoretical possible loss of precision when you assign that result to a float. … Read More
Did you read my previous post? I explained why you get precision-related errors, and how to fix them, but you seem to have ignored it. Read More
In Java when you enter a floating point literal like 9.0 the compiler creates a double value, not a float. That's where ypur doubles are coming from. So when you then assign that value to a float you have a possible loss of precision - hence the warnings. Either make … Read More
The calculation from Celsius to Fahrenheit is incorrect.
First multiply the temperature (C) by 1.8 and then add 32.
The correct calcuation would be `(1.8*c)+32`
`(9.0/5.0)` would be 1.8 Read More