--- title: "Know Your Gas Hogs" id: 76476 type: "computer_media" slug: "know-your-gas-hogs" url: "http://localhost/computer_media/know-your-gas-hogs/" markdown_url: "http://localhost/computer_media/know-your-gas-hogs.md" published_at: "2026-11-11T08:02:41+00:00" modified_at: "2026-11-11T08:02:41+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/11/know-your-gas-hogs-1.png" excerpt: "Compare two vehicles' fuel bills for a year: enter the miles, the price of gas and each vehicle's mileage." post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 1000" slug: "ts1000" taxonomy: "post_tag" url: "http://localhost/tag/ts1000/" - name: "ZX81" slug: "zx81" taxonomy: "post_tag" url: "http://localhost/tag/zx81/" model: - name: "Sinclair ZX81" slug: "zx81" taxonomy: "model" url: "http://localhost/model/zx81/" - name: "Timex/Sinclair 1000" slug: "ts-1000" taxonomy: "model" url: "http://localhost/model/ts-1000/" indiv: - name: "Mel Routt" slug: "mel-routt" taxonomy: "indiv" url: "http://localhost/indiv/mel-routt/" genre: - name: "Home" slug: "home" taxonomy: "genre" url: "http://localhost/type/home/" media_type: "Program" programmers: - name: "Mel Routt" slug: "mel-routt" taxonomy: "indiv" url: "http://localhost/indiv/mel-routt/" download_url: "https://archive.org/download/timex-sinclair-software-archive/Know%20Your%20Gas%20Hogs%20%281981%29%28Routt%2C%20Mel%29%28TS1000%29%28US%29%28Program%29.zip" mediadate: "1981" images: - url: "http://localhost/wp-content/uploads/2026/11/know-your-gas-hogs-1.png" article_media: - id: 19660 title: "Know Your Gas Hogs" type: "article" url: "http://localhost/article/know-your-gas-hogs/" media_type_tags: "Home" license: false --- # Know Your Gas Hogs Answer MILES =, PRICE/GAL =, VEH 1 MPG = and VEH 2 MPH = (a printed typo for MPG). The program prints how many gallons each vehicle would use for those miles and what the fuel would cost, so you can see which one is the gas hog. It was written for the 8K ROM in 1K. Line 140 has no matching LET after its GOSUB, so the second vehicle’s cost is printed without the rounding the first one gets. Published in Syntax September 1981 ([Know Your Gas Hogs](https://timexsinclair.com/article/know-your-gas-hogs/)). ## Source Code ``` 10 PRINT "MILES = "; 15 INPUT M 20 PRINT M 25 PRINT "PRICE/GAL = "; 30 INPUT P 35 PRINT P 40 PRINT "VEH 1 MPG = "; 45 INPUT V1MPG 50 PRINT V1MPG 55 PRINT "VEH 2 MPH = "; 60 INPUT V2MPG 65 PRINT V2MPG 70 LET V1G=M/V1MPG 75 LET X=V1G 80 GOSUB 500 85 LET V1G=X 90 LET V2G=M/V2MPG 95 LET X=V2G 100 GOSUB 500 105 LET V2G=X 110 LET V1D=V1G*P 115 LET X=V1D 120 GOSUB 500 125 LET V1D=X 130 LET V2D=V2G*P 135 LET X=V2D 140 GOSUB 500 150 PRINT 155 PRINT "VEH: GAL: COST:" 160 PRINT 165 PRINT " 1 ";V1G;" $ ";V1D 170 PRINT 175 PRINT " 2 ";V2G;" $ ";V2D 180 STOP 500 LET X=(INT (100*(X+.005)))/100 505 RETURN ```