Question: Matlab Please with comments 8. Th e Eco-Marathon is an annual competition sponsored by Shell Oil, in which participants build special vehicles to achieve the
8. Th e Eco-Marathon is an annual competition sponsored by Shell Oil, in which participants build special vehicles to achieve the highest possible fuel efficiency. The EEco-Marathon is held around the world with events in the United Kingdom, Finland, France, Holland, Japan, and the United States. A world record was set in the Eco-Marathon by a French team in 2003 called Microjoule with a performance of 10,705 miles per gallon. The Microjoule runs on ethanol. Write a MATLAB program to determine how far the Microjoule will travel in kilometers given a user-specified amount of ethanol, provided in units of grams. Your program should ask for the mass using an input statement and display the distance in a formatted sentence similar to the output that follows. If the user provides a mass less than zero or greater than 500 grams, your program should terminate after displaying an error message using the error function indicating that the provided mass of ethanol is outside of the desired range of input. Sample Input/Output (three examples) Enter mass of ethanol Igrams]: -15 Error: Mass must be between 0 and 500 grams Enter mass of ethanol Igrams]: 1000 Error: Mass must be between 0 and 500 grams Enter mass of ethanol Igrams ]: 100 The distance the Microjoule traveled is 577 kilometers
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
