Thoughts, opinions, hints, etc. gladly welcomed.
Frog
#!/usr/bin/perl -w print "Enter the number of teeth on the chainring: "; chomp ($chainring = <STDIN>); print "Enter the number of teeth on the cog: "; chomp ($cog = <STDIN>); if ($cog <= 0) { print "Error: The gear inches cannot be calculated using $cog as a c +og value. Please enter another value."; } else { print "Is your rear wheel metric? (y/n): "; chomp ($_ = <STDIN>); if ($_ eq "y") { print "Enter your metric wheel size in millimeters: "; chomp ($metric = <STDIN>); $wheel = $metric * .039; $gear_inches = ($chainring / $cog) * $wheel; print "The gear inches for a chainring of $chainring teeth and a c +og of $cog teeth and a wheel of $metric millimeters is $gear_inches g +ear inches.\n"; } else { print "Enter your wheel size in inches: "; chomp ($wheel = <STDIN>); $gear_inches = ($chainring / $cog) * $wheel; print "The gear inches for a chainring of $chainring teeth and a c +og of $cog teeth for a wheel $wheel inches in diameter is $gear_inche +s gear inches.\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: A Gear Inch Calculator for Cyclists
by Abigail-II (Bishop) on Aug 12, 2003 at 13:59 UTC | |
by liz (Monsignor) on Aug 12, 2003 at 14:54 UTC | |
|
Re: A Gear Inch Calculator for Cyclists
by CountZero (Bishop) on Aug 13, 2003 at 06:19 UTC |