Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please use matlab the output should be The cost per mile for a rented vehicle is $1.00 for the first 100 miles, $0.80 for the
please use matlab
the output should be
The cost per mile for a rented vehicle is $1.00 for the first 100 miles, $0.80 for the next 200 miles, and $0.70 for all miles in excess of 300 miles. Calculate and display the total cost (t cost) and average cost per mile (a cost pm) for a given input of miles (distance). Utilize the "branching" technique (multiple elseif or nested if construct). Select a, b, or c: c Enter the miles: 90 miles - t cost - a cost - 90 90 1 Select a, b, or c: c Enter the miles: 150 150 t cost - a cost- 0.9333 run Select a, b, or c: c Enter the miles: 400 400 miles t cost a cost - 330 0.8250 Select a, b, or c: z Error using run (line 19) Input a, b, or c ONLY! The cost per mile for a rented vehicle is $1.00 for the first 100 miles, $0.80 for the next 200 miles, and $0.70 for all miles in excess of 300 miles. Calculate and display the total cost (t cost) and average cost per mile (a cost pm) for a given input of miles (distance). Utilize the "branching" technique (multiple elseif or nested if construct). Select a, b, or c: c Enter the miles: 90 miles - t cost - a cost - 90 90 1 Select a, b, or c: c Enter the miles: 150 150 t cost - a cost- 0.9333 run Select a, b, or c: c Enter the miles: 400 400 miles t cost a cost - 330 0.8250 Select a, b, or c: z Error using run (line 19) Input a, b, or c ONLYStep 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