Kurke_Aumea wrote:Apium wrote:Actually looking at that now, I realize that I should have put notes in there so I would know what the fuck I was doing when I looked back at it.
Ahhh, the ever lovely comments. Still, try using indents to help distinguish your if and case statements. It will help you when you're looking for things later. OF course, you probably did use indents, they just didn't make the conversion on the forums. On that note, try using the Code feature when posting coding, it really helps. It is up beside the bold, italics, link, and image tags when you make a post.
What makes programming so messed up is how complex it is to do simple things. For instance, the program you posted is realtively simple, but takes a lot of coding to get it done. That's probably why I hate programming most. Still, if you can understand step-by-step processes, if-else statements, and a few other logical processes programming can be pretty simple to understand.
And yes, I can understand everything in that program... Wow, that means I actually paid attention in programming class...
Still, I am slightly confused by how you are naming your variables. In the one else statement you created two doubles, answer2 and answer25. I'm just curious why you labeled it answer25? Still, quite effective use of an if-else statement and a case statement.
There were indents in such in the actual code it just didnt transfer when i copied and pasted it. It took me 5min to figure out why I had those 2 variables for that else statement. It wasn't giving me the right answers when I used this equation:
Kelvin = ((Fahrenheit - 32) * (5/9)) + 273
so I broke it down.
First I converted it to celsius and stored that in the variable answer2.
Then I converted celsius to kelvin by simply adding 273 which was stored in answer25. The 25 is like 2.5 which is why i named it like that.
This program caused me a lot of grief not b/c of complexity but b/c of the math lol. I was quite proud of this program it was my first one in C++ and i was still 15 at the time. I think I said latest earlier its not its my first for C++. I was thinking of something else.