Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

the output should be

image text in transcribedimage text in transcribed

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 ONLY

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Object Databases The Essentials

Authors: Mary E. S. Loomis

1st Edition

020156341X, 978-0201563412

More Books

Students also viewed these Databases questions

Question

Identify how culture affects appropriate leadership behavior

Answered: 1 week ago