Abstraction leads to parameterization
Extracting the general process from a solution implies separating from particular instances …
- currentTemp = (5 / 9)*(reading - 32) ‘temp in C
- change = (5/9)*(midNiteTemp - 32)
- (5/9)*(noonTemp - 32) ‘figure diff in C
The essential process in converting Fahrenheit to Celsius is the differencing and the product
The parameter -- the component that changes from situation to situation -- is the Fahrenheit temperature
Function ConvertToC (tempF) As Integer
ConvertToC = (5/9)*(tempF - 32)
End Function
…
currentTemp = ConvertToC(reading)