Hey guys, how is it going?. two questions, first I was wondering why when I run my code it never shows me what the converted value is, and second I want to avoid the user to input first a value that doesn't work, like strings. Also is it possible to set anything in the options so if they put something different than 1 and 2 it asks them again? thank you so much.
why when I run my code it never shows me what the converted value is
What do you mean lines 18 and 25 print the converted value to the screen. What else are you looking for?
Lines 16 and 23 are formatted input expecting a number in this case. If you enter anything other than a number the input stream will fail. This can be checked in a while loop while (!cin). inside the loop you can print an error message, clear the stream and clear the input buffer before asking for input again. This the while loop will continue until a number is input.
Follow the first if with an else to inform the used of invalid input before the program ends. I suggest a pause to give the user a chance to read the message before the program ends. The other option is to create a function to print the menu and get user input. Followed by validating the input and returning a goof number. When I do something like this I generally use the menu function.
Hello Andy, what I mean is that when I input cin>> temperatureF; the number in the line above it doesn't run the operation of the next following lines.
I believe your special character ’ is breaking it. Try the standard '.
Guessing you could also use wcout to handle it or some other fixes.
Seems mixing cout with wcout is a bad idea though. Not something I know too much about.