Cody

# Problem 42445. Converter temp 0 to 200 degree C to 4 to 20mA

Solution 1982637

Submitted on 19 Oct 2019 by Nikolaos Nikolaou
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
x = 0; y_correct = 4; assert(isequal(current_temp(x),y_correct))

y = Columns 1 through 18 4.0000 4.0800 4.1600 4.2400 4.3200 4.4000 4.4800 4.5600 4.6400 4.7200 4.8000 4.8800 4.9600 5.0400 5.1200 5.2000 5.2800 5.3600 Columns 19 through 36 5.4400 5.5200 5.6000 5.6800 5.7600 5.8400 5.9200 6.0000 6.0800 6.1600 6.2400 6.3200 6.4000 6.4800 6.5600 6.6400 6.7200 6.8000 Columns 37 through 54 6.8800 6.9600 7.0400 7.1200 7.2000 7.2800 7.3600 7.4400 7.5200 7.6000 7.6800 7.7600 7.8400 7.9200 8.0000 8.0800 8.1600 8.2400 Columns 55 through 72 8.3200 8.4000 8.4800 8.5600 8.6400 8.7200 8.8000 8.8800 8.9600 9.0400 9.1200 9.2000 9.2800 9.3600 9.4400 9.5200 9.6000 9.6800 Columns 73 through 90 9.7600 9.8400 9.9200 10.0000 10.0800 10.1600 10.2400 10.3200 10.4000 10.4800 10.5600 10.6400 10.7200 10.8000 10.8800 10.9600 11.0400 11.1200 Columns 91 through 108 11.2000 11.2800 11.3600 11.4400 11.5200 11.6000 11.6800 11.7600 11.8400 11.9200 12.0000 12.0800 12.1600 12.2400 12.3200 12.4000 12.4800 12.5600 Columns 109 through 126 12.6400 12.7200 12.8000 12.8800 12.9600 13.0400 13.1200 13.2000 13.2800 13.3600 13.4400 13.5200 13.6000 13.6800 13.7600 13.8400 13.9200 14.0000 Columns 127 through 144 14.0800 14.1600 14.2400 14.3200 14.4000 14.4800 14.5600 14.6400 14.7200 14.8000 14.8800 14.9600 15.0400 15.1200 15.2000 15.2800 15.3600 15.4400 Columns 145 through 162 15.5200 15.6000 15.6800 15.7600 15.8400 15.9200 16.0000 16.0800 16.1600 16.2400 16.3200 16.4000 16.4800 16.5600 16.6400 16.7200 16.8000 16.8800 Columns 163 through 180 16.9600 17.0400 17.1200 17.2000 17.2800 17.3600 17.4400 17.5200 17.6000 17.6800 17.7600 17.8400 17.9200 18.0000 18.0800 18.1600 18.2400 18.3200 Columns 181 through 198 18.4000 18.4800 18.5600 18.6400 18.7200 18.8000 18.8800 18.9600 19.0400 19.1200 19.2000 19.2800 19.3600 19.4400 19.5200 19.6000 19.6800 19.7600 Columns 199 through 201 19.8400 19.9200 20.0000 y = 4

2   Pass
x = 200; y_correct = 20; assert(isequal(current_temp(x),y_correct))

y = Columns 1 through 18 4.0000 4.0800 4.1600 4.2400 4.3200 4.4000 4.4800 4.5600 4.6400 4.7200 4.8000 4.8800 4.9600 5.0400 5.1200 5.2000 5.2800 5.3600 Columns 19 through 36 5.4400 5.5200 5.6000 5.6800 5.7600 5.8400 5.9200 6.0000 6.0800 6.1600 6.2400 6.3200 6.4000 6.4800 6.5600 6.6400 6.7200 6.8000 Columns 37 through 54 6.8800 6.9600 7.0400 7.1200 7.2000 7.2800 7.3600 7.4400 7.5200 7.6000 7.6800 7.7600 7.8400 7.9200 8.0000 8.0800 8.1600 8.2400 Columns 55 through 72 8.3200 8.4000 8.4800 8.5600 8.6400 8.7200 8.8000 8.8800 8.9600 9.0400 9.1200 9.2000 9.2800 9.3600 9.4400 9.5200 9.6000 9.6800 Columns 73 through 90 9.7600 9.8400 9.9200 10.0000 10.0800 10.1600 10.2400 10.3200 10.4000 10.4800 10.5600 10.6400 10.7200 10.8000 10.8800 10.9600 11.0400 11.1200 Columns 91 through 108 11.2000 11.2800 11.3600 11.4400 11.5200 11.6000 11.6800 11.7600 11.8400 11.9200 12.0000 12.0800 12.1600 12.2400 12.3200 12.4000 12.4800 12.5600 Columns 109 through 126 12.6400 12.7200 12.8000 12.8800 12.9600 13.0400 13.1200 13.2000 13.2800 13.3600 13.4400 13.5200 13.6000 13.6800 13.7600 13.8400 13.9200 14.0000 Columns 127 through 144 14.0800 14.1600 14.2400 14.3200 14.4000 14.4800 14.5600 14.6400 14.7200 14.8000 14.8800 14.9600 15.0400 15.1200 15.2000 15.2800 15.3600 15.4400 Columns 145 through 162 15.5200 15.6000 15.6800 15.7600 15.8400 15.9200 16.0000 16.0800 16.1600 16.2400 16.3200 16.4000 16.4800 16.5600 16.6400 16.7200 16.8000 16.8800 Columns 163 through 180 16.9600 17.0400 17.1200 17.2000 17.2800 17.3600 17.4400 17.5200 17.6000 17.6800 17.7600 17.8400 17.9200 18.0000 18.0800 18.1600 18.2400 18.3200 Columns 181 through 198 18.4000 18.4800 18.5600 18.6400 18.7200 18.8000 18.8800 18.9600 19.0400 19.1200 19.2000 19.2800 19.3600 19.4400 19.5200 19.6000 19.6800 19.7600 Columns 199 through 201 19.8400 19.9200 20.0000 y = 20

3   Pass
x = 100; y_correct = 12; assert(isequal(current_temp(x),y_correct))

y = Columns 1 through 18 4.0000 4.0800 4.1600 4.2400 4.3200 4.4000 4.4800 4.5600 4.6400 4.7200 4.8000 4.8800 4.9600 5.0400 5.1200 5.2000 5.2800 5.3600 Columns 19 through 36 5.4400 5.5200 5.6000 5.6800 5.7600 5.8400 5.9200 6.0000 6.0800 6.1600 6.2400 6.3200 6.4000 6.4800 6.5600 6.6400 6.7200 6.8000 Columns 37 through 54 6.8800 6.9600 7.0400 7.1200 7.2000 7.2800 7.3600 7.4400 7.5200 7.6000 7.6800 7.7600 7.8400 7.9200 8.0000 8.0800 8.1600 8.2400 Columns 55 through 72 8.3200 8.4000 8.4800 8.5600 8.6400 8.7200 8.8000 8.8800 8.9600 9.0400 9.1200 9.2000 9.2800 9.3600 9.4400 9.5200 9.6000 9.6800 Columns 73 through 90 9.7600 9.8400 9.9200 10.0000 10.0800 10.1600 10.2400 10.3200 10.4000 10.4800 10.5600 10.6400 10.7200 10.8000 10.8800 10.9600 11.0400 11.1200 Columns 91 through 108 11.2000 11.2800 11.3600 11.4400 11.5200 11.6000 11.6800 11.7600 11.8400 11.9200 12.0000 12.0800 12.1600 12.2400 12.3200 12.4000 12.4800 12.5600 Columns 109 through 126 12.6400 12.7200 12.8000 12.8800 12.9600 13.0400 13.1200 13.2000 13.2800 13.3600 13.4400 13.5200 13.6000 13.6800 13.7600 13.8400 13.9200 14.0000 Columns 127 through 144 14.0800 14.1600 14.2400 14.3200 14.4000 14.4800 14.5600 14.6400 14.7200 14.8000 14.8800 14.9600 15.0400 15.1200 15.2000 15.2800 15.3600 15.4400 Columns 145 through 162 15.5200 15.6000 15.6800 15.7600 15.8400 15.9200 16.0000 16.0800 16.1600 16.2400 16.3200 16.4000 16.4800 16.5600 16.6400 16.7200 16.8000 16.8800 Columns 163 through 180 16.9600 17.0400 17.1200 17.2000 17.2800 17.3600 17.4400 17.5200 17.6000 17.6800 17.7600 17.8400 17.9200 18.0000 18.0800 18.1600 18.2400 18.3200 Columns 181 through 198 18.4000 18.4800 18.5600 18.6400 18.7200 18.8000 18.8800 18.9600 19.0400 19.1200 19.2000 19.2800 19.3600 19.4400 19.5200 19.6000 19.6800 19.7600 Columns 199 through 201 19.8400 19.9200 20.0000 y = 12

4   Pass
x = 50; y_correct = 8; assert(isequal(current_temp(x),y_correct))

y = Columns 1 through 18 4.0000 4.0800 4.1600 4.2400 4.3200 4.4000 4.4800 4.5600 4.6400 4.7200 4.8000 4.8800 4.9600 5.0400 5.1200 5.2000 5.2800 5.3600 Columns 19 through 36 5.4400 5.5200 5.6000 5.6800 5.7600 5.8400 5.9200 6.0000 6.0800 6.1600 6.2400 6.3200 6.4000 6.4800 6.5600 6.6400 6.7200 6.8000 Columns 37 through 54 6.8800 6.9600 7.0400 7.1200 7.2000 7.2800 7.3600 7.4400 7.5200 7.6000 7.6800 7.7600 7.8400 7.9200 8.0000 8.0800 8.1600 8.2400 Columns 55 through 72 8.3200 8.4000 8.4800 8.5600 8.6400 8.7200 8.8000 8.8800 8.9600 9.0400 9.1200 9.2000 9.2800 9.3600 9.4400 9.5200 9.6000 9.6800 Columns 73 through 90 9.7600 9.8400 9.9200 10.0000 10.0800 10.1600 10.2400 10.3200 10.4000 10.4800 10.5600 10.6400 10.7200 10.8000 10.8800 10.9600 11.0400 11.1200 Columns 91 through 108 11.2000 11.2800 11.3600 11.4400 11.5200 11.6000 11.6800 11.7600 11.8400 11.9200 12.0000 12.0800 12.1600 12.2400 12.3200 12.4000 12.4800 12.5600 Columns 109 through 126 12.6400 12.7200 12.8000 12.8800 12.9600 13.0400 13.1200 13.2000 13.2800 13.3600 13.4400 13.5200 13.6000 13.6800 13.7600 13.8400 13.9200 14.0000 Columns 127 through 144 14.0800 14.1600 14.2400 14.3200 14.4000 14.4800 14.5600 14.6400 14.7200 14.8000 14.8800 14.9600 15.0400 15.1200 15.2000 15.2800 15.3600 15.4400 Columns 145 through 162 15.5200 15.6000 15.6800 15.7600 15.8400 15.9200 16.0000 16.0800 16.1600 16.2400 16.3200 16.4000 16.4800 16.5600 16.6400 16.7200 16.8000 16.8800 Columns 163 through 180 16.9600 17.0400 17.1200 17.2000 17.2800 17.3600 17.4400 17.5200 17.6000 17.6800 17.7600 17.8400 17.9200 18.0000 18.0800 18.1600 18.2400 18.3200 Columns 181 through 198 18.4000 18.4800 18.5600 18.6400 18.7200 18.8000 18.8800 18.9600 19.0400 19.1200 19.2000 19.2800 19.3600 19.4400 19.5200 19.6000 19.6800 19.7600 Columns 199 through 201 19.8400 19.9200 20.0000 y = 8

5   Pass
x = 125; y_correct = 14; assert(isequal(current_temp(x),y_correct))

y = Columns 1 through 18 4.0000 4.0800 4.1600 4.2400 4.3200 4.4000 4.4800 4.5600 4.6400 4.7200 4.8000 4.8800 4.9600 5.0400 5.1200 5.2000 5.2800 5.3600 Columns 19 through 36 5.4400 5.5200 5.6000 5.6800 5.7600 5.8400 5.9200 6.0000 6.0800 6.1600 6.2400 6.3200 6.4000 6.4800 6.5600 6.6400 6.7200 6.8000 Columns 37 through 54 6.8800 6.9600 7.0400 7.1200 7.2000 7.2800 7.3600 7.4400 7.5200 7.6000 7.6800 7.7600 7.8400 7.9200 8.0000 8.0800 8.1600 8.2400 Columns 55 through 72 8.3200 8.4000 8.4800 8.5600 8.6400 8.7200 8.8000 8.8800 8.9600 9.0400 9.1200 9.2000 9.2800 9.3600 9.4400 9.5200 9.6000 9.6800 Columns 73 through 90 9.7600 9.8400 9.9200 10.0000 10.0800 10.1600 10.2400 10.3200 10.4000 10.4800 10.5600 10.6400 10.7200 10.8000 10.8800 10.9600 11.0400 11.1200 Columns 91 through 108 11.2000 11.2800 11.3600 11.4400 11.5200 11.6000 11.6800 11.7600 11.8400 11.9200 12.0000 12.0800 12.1600 12.2400 12.3200 12.4000 12.4800 12.5600 Columns 109 through 126 12.6400 12.7200 12.8000 12.8800 12.9600 13.0400 13.1200 13.2000 13.2800 13.3600 13.4400 13.5200 13.6000 13.6800 13.7600 13.8400 13.9200 14.0000 Columns 127 through 144 14.0800 14.1600 14.2400 14.3200 14.4000 14.4800 14.5600 14.6400 14.7200 14.8000 14.8800 14.9600 15.0400 15.1200 15.2000 15.2800 15.3600 15.4400 Columns 145 through 162 15.5200 15.6000 15.6800 15.7600 15.8400 15.9200 16.0000 16.0800 16.1600 16.2400 16.3200 16.4000 16.4800 16.5600 16.6400 16.7200 16.8000 16.8800 Columns 163 through 180 16.9600 17.0400 17.1200 17.2000 17.2800 17.3600 17.4400 17.5200 17.6000 17.6800 17.7600 17.8400 17.9200 18.0000 18.0800 18.1600 18.2400 18.3200 Columns 181 through 198 18.4000 18.4800 18.5600 18.6400 18.7200 18.8000 18.8800 18.9600 19.0400 19.1200 19.2000 19.2800 19.3600 19.4400 19.5200 19.6000 19.6800 19.7600 Columns 199 through 201 19.8400 19.9200 20.0000 y = 14