Question: Problem 6 . 1 5 Subfunctions are functions that exist within a larger primary function. They can only be called from within that larger function.

Problem 6.15
Subfunctions are functions that exist within a larger primary function. They can only be called from within that larger function.
(a) Create a primary function called temperature_conversion_table. It should accept an array of temperature values called TC in degrees C and return a table array consisting of 4 columns.
The first column should contain the original array (temperature in degrees C)
The second column should contain corresponding temperatures in kelvins (K)
The third column should contain corresponding temperatures in degrees R
The fourth column should contain corresponding temperature in degrees F
(b) To create the table array define 3 subfunctions then use them to calculate arrays called TK, TR and TF respectively.
C_to_K based on the formula TK = TC +273.15
C_to_R based on the formula TR =(TC +273.15)*1.8
C_to_F based on the formula TF =(TC +273.15)*1.8-459.6
(c) Use the TK, TR and TF arrays with the table function to create the output table array.
(d) Specify the column names using the VariableNames parameter and the names array provided
names =["Celsius", "Kelvin","Rankine","Farhenheit"]
Test your function using the test array provided.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Finance Questions!