Converting Celsius to Fahrenheit and Vice Versa in Delphi
I am Studying Delphi, For some reason they use this old language but any
case. I need to build a Weather application that Converts Celsius And
Fahrenheit.
The user has to enter 7 days Weather but This example I just want to
figure out Day 1
So I have first of all created Radio buttons to Choose Celsius and
Fahrenheit, Then if they choose Celsius I have to Convert Celsius to
Fahrenheit and if they choose Fahrenheit I have to Convert it to Celsius.
So This is my Code:
var
Celsius, Fahrenheit,Day1 : Double;
begin
Day1:= fedDay1 ;
Celsius := (Day1 - 32)*5/9;
Fahrenheit := Day1 * 9/5 +32;
if radCelsius.checked then
lblConvertDay1.Caption := FloatToStrF(Fahrenheit,ffFixed,15,2);
else
lblConvertDay1.Caption := FloatToStr(Celsius,ffFixed,15,2);
end;
It gives an Error on fedDay1 This is a Floating Spin Edit
Help please
No comments:
Post a Comment