Programming Fundamentals/Functions/Pseudocode
Appearance
(Redirected from Computer Programming/Subroutines/Pseudocode)
functions.txt
[edit | edit source]Function Main Declare Real fahrenheit Declare Real celsius Assign fahrenheit = GetFahrenheit() Assign celsius = CalculateCelsius(fahrenheit) Call DisplayResult(fahrenheit, celsius) End Function CalculateCelsius (Real fahrenheit) Declare Real celsius Assign celsius = (fahrenheit - 32) * 5 / 9 Return Real celsius Function DisplayResult (Real fahrenheit, Real celsius) Output fahrenheit & "° Fahrenheit is " & celsius & "° Celsius" End Function GetFahrenheit Declare Real fahrenheit Output "Enter Fahrenheit temperature:" Input fahrenheit Return Real fahrenheit