.de DS
.nf
.RS 0.5i
..
.de DE
.RE
.fi
..
.TH MPG 1carl CARL
.SH NAME
mpg \- keep track of gas mileage
.SH SYNOPSIS
.B mpg
[
.B \-v
] [
.B \-t
] [
.B mileage_log
]
.SH DESCRIPTION
.B mpg
reads a \fImileage_log\fP (or standard input) and computes
the gas mileage from it.
.PP
The format of the \fImileage_log\fP is as follows:
.DS
<odometer>	<gallons>	<cost>	<company>
.DE
The <company> field is optional and is used when the
.B \-v
flag is given. Lines beginning with a sharp sign (#) are
ignored. Anything after the fourth field is ignored.
Here is a sample \fImileage_log\fP:
.DS
# 1983 honda 650cc nighthawk
# odo	gal	cost	company	date
20098.2	1.935	2.65	mobil	27jul84
20215.8	2.527	3.46	mobil	30jul84
20317.8	2.455	3.41	mobil	25sep84
20415.8	2.083	3.04	mobil	01oct84
20502.0	2.2	3.13	texaco	04oct84
20583.0	2.1	2.83	texaco	08oct84
20681.4	1.967	2.87	mobil	11oct84
20782.5	2.5	3.28	texaco	15oct84
20907.5	2.4	3.24	texaco	18oct84
21024.2	2.624	3.96	mobil	23oct84
21143.3	2.4	3.42	texaco	28oct84
21235.2	1.967	2.87	mobil	03nov84
21343.0	2.28	3.27	texaco	09nov84
21458.9	2.234	3.26	mobil	14nov84
21562.1	2.350	3.43	mobil	17nov84
21663.5	2.236	2.86	mobil	20nov84		started using regular unleaded
21782.7	2.578	3.22	mobil	28nov84
.DE
.PP
The output of
.B mpg
is fairly self-explanatory. It consists of the total
cumulative mileage covered by the \fImileage_log\fR file,
the total gallons, the total amount of money spent, the
average mileage, and the average cost per 100 miles.
.PP
If the
.B \-t
is given it causes a \fItrace\fR of the computations, for
each odometer reading it gives the average mileage and
average cost per 100 miles up to that point.
.PP
If the
.B \-v
flag is given the output of
.B mpg
is slightly more verbose and the fourth field of the \fImileage_log\fR
file comes into play; for each gas company a total amount of money
spent there, the highest cost of a gallon of gas there,
the lowest cost of a gallon of gas there, the average cost of a
gallon of gase there, and the number of visits there is displayed.
.PP
The cost per 100 miles figure is given in order to demonstrate
the fallacy of the claim of the advertisers that their premium
gas (high test, ethel, etc.) has more power and therefore gives
better mileage. One might be misled into believing that if
premium has more power it gives better mileage and this imporoved
mileage offsets its extra cost and that there is a savings, but this
is not the case.
.PP
The easiest way to keep track of your gas mileage is to let the
tank get almost completely empty and then fill it up and write
down the odometer reading. Thereafter each time you get more gas
simply record the odometer reading and the amount of gas bought.
.SH AUTHOR
Rusty Wright
