(b) Find the cost to own" as a function of the number of miles driven for a pair of vehicles from the table, based on the fuel price estimate from part a. (a) What do you think the cost of gasoline will be over the next several years? Prompt the user to enter an estimate of gasoline cost in dollars/ gallon.
Table P7.17 A Comparison of Standard and Hybrid Vehicles Year Model Base Gas Efficiency in-town/highway 2008 Toyota Camry $18,720 21/ Toyota Camry Hybrid $25,350 2008 Toyota Highlander 4WD $28,750 17/ Toyota Highlander 4WD Hybrid $33,700 27/25 mpg (hybrids may actually get better mileage in town than on the road) 2008 Ford Escape 2WD $19,140 24/ Ford Escape 2WD Hybrid $26,495 34/30 mpg One way to compare two vehicles is find the cost to own." Cost to own - Purchase cost + Upkeep + Gasoline cost Assume for this exercise that the upkeep costs are the same, so in our comparison we'll set them equal to zero. Consider the vehicle prices and gas efficiencies shown in Table P7.17.
But will you save money by purchasing a hybrid such as the Toyota Camry rather than a Camry with a standard engine? The hybrid vehicles are considerably more expensive, but get better gas mileage. Automobile companies have responded with more fuel-efficient cars, in particular, hybrid models. Use disp and fprintf to create a table with a title, column headings, and appropriate spacing, MSRP 33/34 mpg 3) Create a SCRIPT file called vehicleCost.m, and solve the following inside it: 7.17 In recent years, the price of gasoline has increased dramatically. Allow the user to enter the starting temperature, the increment between lines, and the number of lines for the table. (e) Generate a table of conversions from Celsius to Fahrenheit. Use disp and fprintf to create a table with a title, column headings, and appropriate spacing. Allow the user to enter the starting temperature and the increment between lines. (b) Generate a table of conversions from Celsius to Rankine. Allow the user to enter the increments in degrees F between lines. (a) Generate a table of conversions from Fahrenheit to Kelvin for values from 0☏ to 200☏. Use the following equations, which describe the relationships between tempera- tures in degrees Fahrenheit (Te), degrees Celsius (TC), kelvins (Tr), and degrees Rankine (TR), respectively: T = Tk - 459,67°R T: = 7c+ 32☏ 9 5 9 You will need to rearrange these expressions to solve some of the problems. 7.13 This problem requires you to generate temperature conversion tables. 2) Create a SCRIPT file called temptables.m and solve the following inside them. Use fprintf to display the volume a third time, only now, print the base Area and height data as well, and round the volume to two decimal places, for example: baseArea = 2, height = 4, volume = 2.67 The actual baseArea, height and volume printed will change based on user input. Use disp again to display the volume with a descriptive message such as the volume is 2.6667 (use num2str to convert the volume to a string and combine with your message).
Use the input function to receive input from the user. 7.3 The volume of a cone is V = 1 * area of the base x height Prompt the user to enter the area of the base and the height of the cone (Figure P7.3). 1) Create a SCRIPT m-file called cone Volume.m and solve the following inside it. Don't forget to include your name, the date, etc. Each of your m-files should include appropriate comments to identify the problem and to describe your calculation process. Point MATLAB/Freemat to this folder and create a separate m-file for each problem below. Transcribed image text: ENGRV14 Assignment 6 Create a folder called assignment.