calcGas - %driven, and the price of one gallon of gas....

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
function [total_cost_of_gas]=calcGas(distance_in_miles,miles_per_gallon_of_vehicle,price_of_ gallon_of_gas) %function to compute the amount of money a person will spend on gas given %the distance traveled in miles, the miles per gallon of the vehicle being
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: %driven, and the price of one gallon of gas. %usage: [price]=calcGas(distance,miles_per_gallon,price_per_gallon_of_gas) total_cost_of_gas=(distance_in_miles./miles_per_gallon_of_vehicle).*price_of_gallon _of_gas;...
View Full Document

This note was uploaded on 10/21/2010 for the course CS 1371 taught by Professor Stallworth during the Spring '08 term at Georgia Institute of Technology.

Ask a homework question - tutors are online