3. In the U.S. fuel efficiency of cars is specified in miles per gallon (mpg). In Europe...

Question:

3. In the U.S. fuel efficiency of cars is specified in miles per gallon (mpg). In Europe it is often expressed in liters per 100 km. Write a MATLAB userdefined function that converts fuel efficiency from mpg to liters per 100 km.

For the function name and arguments, use Lkm=mpgToLpkm(mpg). The input argument mpg is the efficiency in mi/gl, and the output argument Lkm is the efficiency in liters per 100 km (rounded to the nearest hundredth). Use the function in the Command Window to:

(a) Determine the fuel efficiency in liters per 100 km of a car whose fuel efficiency is 21 mi/gal.

(b) Determine the fuel efficiency in liters per 100 km of a car whose fuel efficiency is 36 mi/gal.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: