Main module
Write This program converts Celsius to Fahrenheit and vice versa
call Input module
call Perform Calculation module
call Output Results module
Input module
Declare Fahrenheit, Celsius, Fahrenheit1, Celsius1 as float
Declare Degree-2B-Converted as character
write "Are you converting Celsius to Fahrenheit? (Y /N) "
input Degree-2B-Converted
If Degree-2B-Converted = Y
write "Please enter a Celsius degree for converting"
Input Celsius1
else
if Degree-2B-Converted = N
write "Please enter a Fahrenheit degree for converting"
input Fahrenheit1
else
write "You have entered an invalid entry. Please re-enter a valid character of C or F"
end if
end if
Perform Calculation module
Set Fahrenheit = (Celsius1 * 9)/5 + 32
Set Celsius = (Fahrenheit1 -32) * 5/9
Output Results module
Write With << Celsius1 << Celsius, the Fahrenheit is: << Fahrenheit
Write With << Fahrenheit1 << Fahrenheit, the Celsius is: << Celsius
This post has been edited by macosxnerd101: 31 October 2010 - 09:10 AM
Reason for edit:: Added code tags.

New Topic/Question
Reply
MultiQuote










|