Answered step by step
Verified Expert Solution
Question
1 Approved Answer
USING MATLAB TO SOLVE QUESTION. THANKS 8. The Eco-Marathon is an annual competition sponsored by Shell Oil, in which participants build special vehicles to achieve
USING MATLAB TO SOLVE QUESTION. THANKS
8. The Eco-Marathon is an annual competition sponsored by Shell Oil, in which participants build special vehicles to achieve the highest possible fuel efficiency. The Eco-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 [grams]: -15 Error: Mass must be between 0 and 500 grams Enter mass of ethanol [grams]: 1000 Error: Mass must be between 0 and 500 grams Enter mass of ethanol [grams]: 100 The distance the Microjoule traveled is 577 kilometers. 8. The Eco-Marathon is an annual competition sponsored by Shell Oil, in which participants build special vehicles to achieve the highest possible fuel efficiency. The Eco-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 [grams]: -15 Error: Mass must be between 0 and 500 grams Enter mass of ethanol [grams]: 1000 Error: Mass must be between 0 and 500 grams Enter mass of ethanol [grams]: 100 The distance the Microjoule traveled is 577 kilometersStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started