#!/usr/local/bin/perl # # This program will give you the MPG (Miles Per Gallon) when # you have the given number of miles driven and the gallons # it took to fill the car. # # This program was written by Rick Hogan 980629 # print "This program will caculate the Miles Per Gallon for your car.\n"; print "Please press the return key when you are ready: \n"; <>; print "Please enter the total miles driven: "; $x = <>; chop($x); print "Please enter the number of gallons to fill the tank: "; $y = <>; chop($y); $z = $x / $y; print "You are getting $z miles to the gallon.\n";