Question: (Matlab Format) Instructions Represent Consider creating a flowchart or algorithm to help solve the problem. Plan Create a script file Class_23_App.m and function files as

 (Matlab Format) Instructions Represent Consider creating a flowchart or algorithm to

(Matlab Format)

Instructions

Represent

Consider creating a flowchart or algorithm to help solve the problem.

Plan

Create a script file Class_23_App.m and function files as needed.

Outline the steps your program will take by adding comment statements to your script file.

Imprement

Complete problems 1-3.

Evaluate

Use Excel to verify your solution for problem 2.

Document

Submit the following:

Script file

Function Files

Command window output

Excel Verification

Problem3 Financial and logistical calculations are found in every type of engineering, particularly industrial and systems engineering and civil engineering. Problem Statement You are a civil engineer who wishes to evaluate whether or not driving to a gas station x miles away where gas is n cents cheaper is a money saver or not. In other words, the problem you wish to solve is, "If I am at Station A and it costs Sx.xx per gallon, and gas at Station B is cheaper and costs $x.xx will save money by driving x miles to Station B to get gas? Since a major goal of this assignment is to gain experience with user written functions, you are required to create a function in addition to the script file. Create a function named Cost that has gallons of gas purchased and price per gallon as its inputs and returns the total cost as its output. - Create a function file named Cost.m that Calculates the cost of gas without printing any variables to the screen - . In the script file, Class 24 App.m perform the following tasks: Ask the user for the number of miles their car typically travels on one gallon of gas and the number of gallons needed Ask the user the price of eas at Station A and Station B. -Calculate the cost of filling up at Station A using the function Cost) - Calculate the cost of filling up at Station B using the function Cost) Ask the user for the distance between Station A and Station B Calculate the cost of driving to Station B from Station A with the distance from A to B and the price at Station B using the function Cost) - Compare the costs of filling up at Station A with the costs of travelling to and fing up at Station B. -Based on the cost calculations, display a message that indicates one of the following three options: (1) the savings for buying gas at Station 8, (2) the additional cost for buying gas at Station B, or (3) that there is no cost difference Repeat the program until the user chooses to quit - For testing purposes please use the following inputs for the file you submit Testing Conditions Number of miles per gallon their car typically gets +25 mpg Number of eallons needed 10 eal Price of Gas at Station A $2.45 Price of Gas at Station B $2.15 Distance between A and B 30 miles Repeat Number of miles per gallon their car typically gets 20 mpg Number of gallons needed 5 gal. Price of Gas at Station A-$2.30 Price of Gas at Station B $2.20 Distance between A and B 5 miles Repeat Number of miles per gallon their car typically gets = 40 mpg Number of gallons needed 15 gal. Price of Gas at Station A = $2.50 Price of Gas at Station B $2.40 Distance between A and B 25 miles End

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!