Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Prelab: Understand Function: Convert Fahrenheit Temperature to Celsius - Do it before your lab day 0 solutions submitted ( max: Unlimited ) Two commonly used
Prelab: Understand Function: Convert Fahrenheit Temperature to Celsius
Do it before your lab day
solutions submitted max: Unlimited
Two commonly used scales for measuring temperature are Fahrenheit and Celsius. We will often want to convert temperature in degrees Fahrenheit to Create a function called tempFC that will accept as input a single temperature in degrees Fahrenheit and return the equivalent temperature in degrees
Recall that Fahrenheit and Celsius are related by the following equation:
Function
Save
C Reset
Sofine the function tempFC to convert degree in Fahrenheit to Celsius.
function tempC tempFCtempF
susing the formula to do the convertion. The input is tempF, the format parameter defined in the function.
$The calculated result is assigned to the return variable tempC
end
temp dots;; do add ; at the end for any statement in a function.
Code to call your function
Test your function
; & temperature degree in Fahrenheit
tempFCtF scall your function to convert it to Celsius and store the result in
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started