Hi everyone I am trying to make a program that has the user enter the number followes by a space and the letter f or c for fahrenheit or celcius. i need the program to convert it to the opposite degrees. so if i enter 58 c i need it to convert to fahrenheit, for some reason my program is not working right. It compiles but the numbers are way off. i need to use the formulas that i have in place. Can anyone tell me what I am missing?
Thanks:
- your variable is named 'change' but you refer to it as 'choice'
- F to C code block is missing an if statement
- your { brace on the final else is misplaced
After correcting those errors I got it to compile. And noticed 2 problems:
1) In the first if block you are using the F to C formula when you should be using the C to F formula
2) In the second block, that formula is all wrong. It should be F to C. Double check your formulas.
3) You are taking input backwards from what the assignment dictates. You are getting 'choice' first then 'num1', which means proper input would look like "f 65" instead of "65 f"
Hi sorry for all those silly errors. I corrected most of them but I don't see where I forgot an if statement between the F to C code. Also i nthe second block do you know why the formula is wrong? I switched the formulas for they are the right ones. I think I fixed all the errors. I posted below any feedback is appreciated. Thank You for the tips.