http://www.perlmonks.org?node_id=991668


in reply to Cycle Gear Ratio Calculator

This brought back a nine-year-old memory: A Gear Inch Calculator for Cyclists. I have no idea why I still remembered it.


Dave

Replies are listed 'Best First'.
Re^2: Cycle Gear Ratio Calculator
by fatmac (Acolyte) on Sep 04, 2012 at 18:30 UTC
    That was interesting, especially as they also were reading the same book when they coded it. This is my single gear calculator code:
    #!/usr/bin/perl use strict; use warnings; print "\nGear Calculator\n\n"; print "Enter Wheelsize (inches): "; my $wheel = <>; print "Enter Chainwheel Teeth: "; my $teeth = <>; print "Enter Cog Teeth: "; my $cog = <>; my $gear = $wheel * $teeth / $cog; print "\nYour gear is: ", $gear, "\n\n";