Cody

# Problem 2413. Temperature Conversion Utility

Solution 2672651

Submitted on 9 Jul 2020
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Fail
T = 100; u1 = 'C'; u2 = 'F'; eps = 1e-4; assert(abs(T_convertor(T,u1,u2)-212) < eps)

pair = 'CF' l = ' (?@ 100*(9/5) + 32 ) '

Output argument "T_out" (and maybe others) not assigned during call to "T_convertor". Error in Test1 (line 5) assert(abs(T_convertor(T,u1,u2)-212) < eps)

2   Fail
T = 100; u1 = 'C'; u2 = 'R'; eps = 1e-4; assert(abs(T_convertor(T,u1,u2)-671.67) < eps)

pair = 'CR' l = ' (?@ (100 + 273.15)*9/5 ) '

Output argument "T_out" (and maybe others) not assigned during call to "T_convertor". Error in Test2 (line 5) assert(abs(T_convertor(T,u1,u2)-671.67) < eps)

3   Fail
T = 100; u1 = 'C'; u2 = 'C'; eps = 1e-4; assert(abs(T_convertor(T,u1,u2)-100) < eps)

pair = 'CC' l = ' (?@ 100 ) '

Output argument "T_out" (and maybe others) not assigned during call to "T_convertor". Error in Test3 (line 5) assert(abs(T_convertor(T,u1,u2)-100) < eps)

4   Fail
T = 100; u1 = 'C'; u2 = 'K'; eps = 1e-4; assert(abs(T_convertor(T,u1,u2)-373.15) < eps)

pair = 'CK' l = ' (?@ 273 + 100 ) '

Output argument "T_out" (and maybe others) not assigned during call to "T_convertor". Error in Test4 (line 5) assert(abs(T_convertor(T,u1,u2)-373.15) < eps)

5   Fail
T = 100; u1 = 'K'; u2 = 'F'; eps = 1e-4; assert(abs(T_convertor(T,u1,u2)-(-279.67)) < eps)

pair = 'KF' l = ' (?@ 100*(9/5) - 459.67 ) '

Output argument "T_out" (and maybe others) not assigned during call to "T_convertor". Error in Test5 (line 5) assert(abs(T_convertor(T,u1,u2)-(-279.67)) < eps)

6   Fail
T = 100; u1 = 'K'; u2 = 'R'; eps = 1e-4; assert(abs(T_convertor(T,u1,u2)-180) < eps)

pair = 'KR' l = ' (?@ 100*(9/5) ) '

Output argument "T_out" (and maybe others) not assigned during call to "T_convertor". Error in Test6 (line 5) assert(abs(T_convertor(T,u1,u2)-180) < eps)

7   Fail
T = 100; u1 = 'K'; u2 = 'C'; eps = 1e-4; assert(abs(T_convertor(T,u1,u2)-(-173.15)) < eps)

pair = 'KC' l = ' (?@ 100 - 273 ) '

Output argument "T_out" (and maybe others) not assigned during call to "T_convertor". Error in Test7 (line 5) assert(abs(T_convertor(T,u1,u2)-(-173.15)) < eps)

8   Fail
T = 100; u1 = 'K'; u2 = 'K'; eps = 1e-4; assert(abs(T_convertor(T,u1,u2)-100) < eps)

pair = 'KK' l = ' (?@ 100 ) '

Output argument "T_out" (and maybe others) not assigned during call to "T_convertor". Error in Test8 (line 5) assert(abs(T_convertor(T,u1,u2)-100) < eps)

9   Fail
T = 100; u1 = 'F'; u2 = 'F'; eps = 1e-4; assert(abs(T_convertor(T,u1,u2)-100) < eps)

pair = 'FF' l = ' (?@ 100 ) '

Output argument "T_out" (and maybe others) not assigned during call to "T_convertor". Error in Test9 (line 5) assert(abs(T_convertor(T,u1,u2)-100) < eps)

10   Fail
T = 100; u1 = 'F'; u2 = 'R'; eps = 1e-4; assert(abs(T_convertor(T,u1,u2)-559.67) < eps)

pair = 'FR' l = ' (?@ 459.67*100 ) '

Output argument "T_out" (and maybe others) not assigned during call to "T_convertor". Error in Test10 (line 5) assert(abs(T_convertor(T,u1,u2)-559.67) < eps)

11   Fail
T = 100; u1 = 'F'; u2 = 'C'; eps = 1e-4; assert(abs(T_convertor(T,u1,u2)-37.7777778) < eps)

pair = 'FC' l = ' (?@ (100 - 32)*(9/5) ) '

Output argument "T_out" (and maybe others) not assigned during call to "T_convertor". Error in Test11 (line 5) assert(abs(T_convertor(T,u1,u2)-37.7777778) < eps)

12   Fail
T = 100; u1 = 'F'; u2 = 'K'; eps = 1e-4; assert(abs(T_convertor(T,u1,u2)-310.9277778) < eps)

pair = 'FK' l = ' (?@ (100 + 459.67)*5/9 ) '

Output argument "T_out" (and maybe others) not assigned during call to "T_convertor". Error in Test12 (line 5) assert(abs(T_convertor(T,u1,u2)-310.9277778) < eps)

13   Fail
T = 100; u1 = 'R'; u2 = 'F'; eps = 1e-4; assert(abs(T_convertor(T,u1,u2)-(-359.67)) < eps)

pair = 'RF' l = ' (?@ 100 - 459.67 ) '

Output argument "T_out" (and maybe others) not assigned during call to "T_convertor". Error in Test13 (line 5) assert(abs(T_convertor(T,u1,u2)-(-359.67)) < eps)

14   Fail
T = 100; u1 = 'R'; u2 = 'R'; eps = 1e-4; assert(abs(T_convertor(T,u1,u2)-100) < eps)

pair = 'RR' l = ' (?@ 100 ) '

Output argument "T_out" (and maybe others) not assigned during call to "T_convertor". Error in Test14 (line 5) assert(abs(T_convertor(T,u1,u2)-100) < eps)

15   Fail
T = 100; u1 = 'R'; u2 = 'C'; eps = 1e-4; assert(abs(T_convertor(T,u1,u2)-(-217.5944444)) < eps)

pair = 'RC' l = ' (?@ (100 - 491.67)*(5/9) ) '

Output argument "T_out" (and maybe others) not assigned during call to "T_convertor". Error in Test15 (line 5) assert(abs(T_convertor(T,u1,u2)-(-217.5944444)) < eps)

16   Fail
T = 100; u1 = 'R'; u2 = 'K'; eps = 1e-4; assert(abs(T_convertor(T,u1,u2)-55.5555556) < eps)

pair = 'RK' l = ' (?@ 100*5/9 ) '

Output argument "T_out" (and maybe others) not assigned during call to "T_convertor". Error in Test16 (line 5) assert(abs(T_convertor(T,u1,u2)-55.5555556) < eps)

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!