Home Segments Index Top Previous Next

613: Practice

Suppose that, incredibly, the railroad-car serial-numbering standard changes. Now the fifth and sixth characters are both numbers, with numbers from 10 to 19 indicating box cars, 20 to 29 indicating tank cars, 30 to 39 indicating box cars, 40 to 50 indicating cabooses, and 90 to 99 indicating engines. Modify the program in Segment 611 to accommodate the change. Be sure to change only the extract_car_code function.