CCExtractor Development

[Winnerstrack] Any language: Unit converter

You know how you can google things like "1 meter to feet" and it will tell you

1 meter = 3.28084

Your job is to write an application, in any language you like, that can do the same thing.

Rules: You will have to have a conversion table for different units. For example, 1 meter = 100 centimeters and so on.

Of course you can't have all the possible conversions in your table. This means that your program needs to be smart enough to find a "conversion path". For example, if you have

1 meter = 100 centimeters 1 centimeter = 0.393701 inches 1 inch = 0.0833333 feet

Then your program needs to be able to convert from meters to feet even though it doesn't have a conversion table.

It should work for distance, time, and so on, and it needs to issue an error when a conversion is not possible, for example "10 meters to seconds".

(Major) bonus points if it's able to do complex conversions, for example kilometers per hour to feet per second, or watts to jules per second.

Notes:

  • The conversion tables must come from a human editable file. Don't assume that the user of the program is a software developer than can make changes to the code.
  • Upload your work to a github repo (a new one, please don't mix different tasks in one repo).

Task tags

  • python
  • winnerstrack
  • rust

Students who completed this task

DefinitelyNotAshnxious, ameliorater, Ntarun2803, Lux, kashparty, Musab Kılıç, Knob, LJ, AlephZero, Krzysztof, Arnav17Sharma, Sanat, dhruv_snake_case, Shantanu, blazegod420, RobOHt, Daste, jonot, GeekTech, korneliuszw, cppio, Sudox, dhrumilp15, ShridharS

Task type

  • code Code
close

2019