Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

this is in matlab d: Mar 5 at 9:40am iz Instructions Question 29 2 pts You are renting a car for 4 weekends in a

this is in matlab image text in transcribed
d: Mar 5 at 9:40am iz Instructions Question 29 2 pts You are renting a car for 4 weekends in a row. What you pay is based on how much you drive. Your base rate is $1.90 per mile. 1. If you drive 165 miles or less in a given weekend, you pay the base rate. 2. Otherwise you still pay the base per mile rate and then a 553 extra fee. You drive 214 miles the first weekenly 235 miles the second weekend, 132 miles the third weekend, and 291 miles the fourth weekend. Store your mileage in a vector and loop through your vector to calculate the total you owe. Display the total you owe in an fprintf statement using two decimal places. Don't forget the dollar sign. While you should use the values provided, your code should be able to work for any vector of weekly miles, Type the total you owe (without the dollar sign) in the blank for this problem. Next O

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

The Database Management Systems

Authors: Patricia Ward, George A Dafoulas

1st Edition

1844804526, 978-1844804528

More Books

Students also viewed these Databases questions