Temperature Conversion

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
Zeerus
Coder
Posts: 31
Joined: Thu Jun 16, 2005 1:10 pm
Location: Central Florida
Contact:

Temperature Conversion

Post by Zeerus »

nevermind, I figured my problem out
it was just simple code formatting errors
Image
User avatar
Deleter
Veteran
Posts: 119
Joined: Sat May 07, 2005 7:31 pm

Post by Deleter »

its because 5 / 9 * (f - 32) = -17.77777778. f = 0. what you have to do is put the LET c = 5 / 9 * (f - 32) AFTER you input f.
so like this:

Code: Select all

INPUT "Please enter a temperature in Fahrenheit"; f
LET c = 5 / 9 * (f - 32)
PRINT "A temperature of "; f ;" degrees Fahrenheight equals "; c ;" degrees celsius"
'
END 
Zeerus
Coder
Posts: 31
Joined: Thu Jun 16, 2005 1:10 pm
Location: Central Florida
Contact:

Post by Zeerus »

I figured that out a few minutes ago
I must have changed my post right as you posted your answer

thanks for hte help anyway
Image
User avatar
Deleter
Veteran
Posts: 119
Joined: Sat May 07, 2005 7:31 pm

Post by Deleter »

np, I noticed that you edited it after I posted....I didn't bother messing around with it
Post Reply