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


in reply to Re: Cycle Gear Ratio Calculator
in thread Cycle Gear Ratio Calculator

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";