View Full Version : My little app.
trenzterra
November 30th, 2002, 10:47
OK, after days of playing with C++, I made a temperature converter... maybe you can use it too
http://trenzterra.yupapa.com/tempconvert.zip
what do you think?
it's open source.
conkermaniac
November 30th, 2002, 11:19
Hmm...well, I've never had any problems with converting temperature, so it's not an issue.
I created something like that in my first week of learning Java too...except yours is much more presentable, I guess, lol. Good work! :D
trenzterra
November 30th, 2002, 22:08
Thanks. What is yours presented in?
conkermaniac
November 30th, 2002, 22:17
Originally posted by trenzterra
Thanks. What is yours presented in?
Oh, mine is coded in Java, but it looks essentially the same, as an executable. :)
Daniel
November 30th, 2002, 22:33
Hey trenz...wanna team up and make err...a 1337-translator thing? :p
trenzterra
November 30th, 2002, 22:52
Originally posted by Daniel
Hey trenz...wanna team up and make err...a 1337-translator thing? :p Maybe when my C++ skills get better!
Bruce
November 30th, 2002, 22:59
What the hell?
Are you using Visual C++ or something? That's some fo teh strangest code I've ever seen. :confused2
trenzterra
November 30th, 2002, 23:34
Originally posted by Bruce
What the hell?
Are you using Visual C++ or something? That's some fo teh strangest code I've ever seen. :confused2 I used Dev-C++. Why is it strange?
Daniel
November 30th, 2002, 23:49
Trenz, what compiler did you use?
Bruce
December 1st, 2002, 00:13
Originally posted by trenzterra
I used Dev-C++. Why is it strange? Although I do most of my programming on a Mac, I wouldn't have expected Windows to be this different...
I don't get what all of these .erase, .get etc. commands are. Are they Windows specific or something?
Maybe it's just you're code I can't follow... it definatley isn't teh prettiest code I've seen. ;)
Didn't anyone ever tell you to declare all your variables at the beginning of your program? :p
I just can't follow your code... I've attached my C++ temperature conversion as a reference...
Daniel, look up. Apparently he used Dev-C++.
Daniel
December 1st, 2002, 00:22
Thanks Bruce.
Dusty
December 1st, 2002, 00:38
Dev-C++ uses Mingw for a compiler.
trenzterra
December 1st, 2002, 01:17
Originally posted by Bruce
Although I do most of my programming on a Mac, I wouldn't have expected Windows to be this different...
I don't get what all of these .erase, .get etc. commands are. Are they Windows specific or something?
Maybe it's just you're code I can't follow... it definatley isn't teh prettiest code I've seen. ;)
Didn't anyone ever tell you to declare all your variables at the beginning of your program? :p
I just can't follow your code... I've attached my C++ temperature conversion as a reference...
Daniel, look up. Apparently he used Dev-C++. I like making stuff complicated.:biggrin2:
Ben
December 1st, 2002, 01:44
Originally posted by Dusty
Dev-C++ uses Mingw for a compiler.
Isn't that the Win32 port of GCC/G++?
jon787
December 1st, 2002, 04:04
Originally posted by Ben
Isn't that the Win32 port of GCC/G++?
Mingw is a minimalist version of GCC that is ported to Windows.
conkermaniac
December 1st, 2002, 05:29
Heh, I was bored, so I decided that I would create this temperature conversion - for Celsius, Fahrenheit, AND Kelvin. This one is on the web, so you don't have to download anything. It only has two functions - to convert and to check whether your temperature is above absolute zero or not. ;)
http://www.free.9cy.net/tempconvert.html
LeX
December 1st, 2002, 05:38
Originally posted by trenzterra
I like making stuff complicated.:biggrin2: That's something programmers try to avoid.....
trenzterra
December 1st, 2002, 09:11
I haven't considered Kelvin yet, seems complicated.
LeX
December 2nd, 2002, 07:23
Are you serious?
All you have to do is add about 273 degrees to the celcius degree....
trenzterra
December 2nd, 2002, 07:26
i haven't figured it out yet.. i will when i get more time.
and version 1.1 coming soon, it will fix a bug in fahrenheit to celcius above 32 degrees.
Bruce
December 2nd, 2002, 14:51
Trenz, you're realy making things more difficult then they should be. All you really needed for the temperature converter were a few lines of code, not an entire novel.
trenzterra
December 2nd, 2002, 23:11
Anyway i fix that error... version 1.1 released
I don't know anything about that 5/9 thingy and stuff.
conkermaniac
December 3rd, 2002, 07:06
Originally posted by trenzterra
I haven't considered Kelvin yet, seems complicated.
function C(K)
C = K - 273.15
end function
that's how you do it in VBScript...you probably can figure out the C++ equivalent. I only learned Java, so I can't help there. :D
GregT
December 10th, 2002, 01:16
Can somebody tell me how to convert all these ? (kelvin, celcius, fareheight) i'm an idiont and dont know how to convert. (or read trenzbaby's code) I want to make a clean version in perl :D
Dusty
December 10th, 2002, 11:23
I think these will work, but I haven't tried them:
Fahrenheit to Celsius:
$celsius=5/9*($fahrenheit-32);
Celsius to Fahrenheit:
$fahrenheit=9/5*$celsius+32;
Celsius to Kelvin:
$kelvin=$celsius+273.15;
Kelvin to Celsius:
$celsius=$kelvin-273.15;
Powered by vBulletin® Version 4.1.7 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.