Cody

Solution 1387692

Submitted on 20 Dec 2017 by David Verrelli
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   Pass
T = 100; u1 = 'C'; u2 = 'F'; eps = 1e-4; assert(abs(T_convertor(T,u1,u2)-212) < eps)

r=1, c=3; A=1.800000, B=32.000000. T_out = 212

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

r=1, c=4; A=1.800000, B=491.670000. T_out = 671.6700

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

r=1, c=1; A=1.000000, B=0.000000. T_out = 100

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

r=1, c=2; A=1.000000, B=273.150000. T_out = 373.1500

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

r=2, c=3; A=1.800000, B=-459.670000. T_out = -279.6700

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

r=2, c=4; A=1.800000, B=0.000000. T_out = 180

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

r=2, c=1; A=1.000000, B=-273.150000. T_out = -173.1500

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

r=2, c=2; A=1.000000, B=0.000000. T_out = 100

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

r=3, c=3; A=1.000000, B=0.000000. T_out = 100

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

r=3, c=4; A=1.000000, B=459.670000. T_out = 559.6700

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

r=3, c=1; A=0.555556, B=-17.777800. T_out = 37.7778

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

r=3, c=2; A=0.555556, B=255.372200. T_out = 310.9278

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

r=4, c=3; A=1.000000, B=-459.670000. T_out = -359.6700

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

r=4, c=4; A=1.000000, B=0.000000. T_out = 100

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

r=4, c=1; A=0.555556, B=-273.150000. T_out = -217.5944

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

r=4, c=2; A=0.555556, B=0.000000. T_out = 55.5556