0
votes

With the code below, I am trying to have the user enter in temperature like this "10 F" and then validate it to make sure it is not below absolute zero with the temperature of type Fahrenheit, Kelvin, and Celsius. When checking I am getting the following error on line 211:

"Execution error (ClassCastException) at temperatureTester/readTemp (temperature.clj:211). class java.lang.Character are in module java.base of loader 'bootstrap')"

The following is the code (I am using a picture since I am wirelessly connecting to the PC and cannot copy & paste it in). It is not in the creating of the Temp itself as it works in the other operations.

Code Here

1
degree should be parsed to number to be used in numeric operations : degree (Integer/parseInt (subs ...)) - leetwinski

1 Answers

0
votes

You need to parse the numeric portion from a string into a number using something like

(Double/parseDouble "98.6")  => 98.6

You may also find it easier to parse using regular expressions instead of subs