But my code worked, it outputted 86 degrees Fahrenheit when you inputted 30 degrees Celsius.
But my code worked, it outputted 86 degrees Fahrenheit when you inputted 30 degrees Celsius.
"The Internet treats censorship as damage and routes around it." - John Gilmore
yes i know it worked but i wanted to change it differently thats all.
Ah ok, I am not really good at making alternative equasions.
"The Internet treats censorship as damage and routes around it." - John Gilmore
its ok, you think you can help with my new problem with the equation?
Not at the moment, it's bedtime
"The Internet treats censorship as damage and routes around it." - John Gilmore
right ok, anyone else?
This:
Should be this:Code:mDegreesC = 9.0/5.0*(DegreesF-32.0);
Code:mDegreesC = 1.8*DegreesF+32.0;
i would use that but i need to use the full formula which is the one that i have.
i dont know if there is anything wrong with the GetDegreesF function when i return it?
because when i put in the temperature it comes up with a weird number. and then whatever i put in for the next number it will come up as 57.6
Last edited by peckitt99; 11-02-2006 at 04:30 PM.
still not managed to figure this one out. can anyone help?
Have you tried adding 32 not subtracting it?
Does it have anything to do with the conversion formulas, or that your code has some other problems. As you describe it, may-be you could show the code that is giving problems.Originally Posted by peckitt99
Have you fixed the problem that the class should only store the temperature in one variable, to avoid the termometer storing two different temperatures at a time? I would suggest Kelvins for that (makes it easy to check you don't get below 0 K).
It's easy to find conversion formulas on the Internet, for example here.
isn't this a lot easier
Code:#include<iostream.h> int main() { int temp1; double temp2, temp3; char temp4; cout<<"(1)Fahrenheit or (2)Celcius?"<<endl; cin>>temp1; cout<<"Degree?"<<endl; cin>>temp2; if(temp1==1) { temp3=((.056)*(temp2-32))*10; temp4='C'; } if(temp1==2) { temp3=(temp2)*(1.8)+32; temp4='F'; } cout<<temp3<<" deg "<<temp4<<endl; return 0; }
it has to be in a class
its ok thanx i got it. thanks for your help