UkLumNz Posted November 14, 2012 Share Posted November 14, 2012 Hi guys, I've been going over chapter 3 today, script 3.10 calculator.php #5 and unless I'm being stupid (most likely) is their an error on line 30 ? Instead of (Larrys code): // Get the cost of those gallons $dollars = $gallons / $ppg; Should it not be: // Get the cost of those gallons $dollars = $gallons * $ppg; After completing the Script and running the results (submitting the form data) using $dollars = $gallons / $ppg; this just did not look right: Total Estimated Cost: The total cost of driving 300 miles, averaging 30 miles per gallon, and paying an average of $3.00 per gallon, is $3.33. If you drive at an average of 65 miles per hour, the trip will take approximately 4.62 hours. Sorry if this has been answered elsewhere (I did check the errata but it contained no reference). But I just thought I'd bring it up, and make sure I'm not having a braindead moment Cheers Link to comment Share on other sites More sharing options...
Larry Posted November 14, 2012 Share Posted November 14, 2012 Yes, this is already listed on the errata page. Sorry about the confusion. Link to comment Share on other sites More sharing options...
UkLumNz Posted November 14, 2012 Author Share Posted November 14, 2012 Thanks for the reply Larry, Its much appreciated (great book also by the way.). Its funny how I could spot it in the book, but not in the errata lol. Link to comment Share on other sites More sharing options...
Larry Posted November 20, 2012 Share Posted November 20, 2012 No problem. Thanks for the nice words on the book! Link to comment Share on other sites More sharing options...
Recommended Posts