Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using MatLab: You have been hired by a used-car dealership to modify the price of the cares that are up fpr sale. Write a function

Using MatLab:

You have been hired by a used-car dealership to modify the price of the cares that are up fpr sale. Write a function called usedCar that takes in a structure with the following fields:

Make: A string that represents the make of the car(e.g."Toyota")

Year: A number that correspons to the year of the car(e.g. 2017)

Cost: A number that holds the marked price of the car(e.g. 12,000)

Miles: The numbe of miles clocked (e.g. 85,000)

Accidents: The number of accidents the car has been in (e. g. 1)

Your function should return a structure with all the above field, with exactly the same names. Here are the changes you must make within the function regarding a input car structure parameter:

1. Add 3,000 to the cost if the car has clocked less than 20,000 miles

2.substract 3,000 if it has clocked more than 100,000 miles.

3. reduce the price by 5,000 for every accident. make sure the reduced price is no less than $1000 (If the reduced price is less than 1000, keeps the price at 1000).

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

Advances In Databases And Information Systems 23rd European Conference Adbis 2019 Bled Slovenia September 8 11 2019 Proceedings Lncs 11695

Authors: Tatjana Welzer ,Johann Eder ,Vili Podgorelec ,Aida Kamisalic Latific

1st Edition

3030287297, 978-3030287290

More Books

Students also viewed these Databases questions

Question

Define the process of communication

Answered: 1 week ago

Question

Explain the importance of effective communication

Answered: 1 week ago

Question

* What is the importance of soil testing in civil engineering?

Answered: 1 week ago

Question

Explain the concept of shear force and bending moment in beams.

Answered: 1 week ago

Question

Question Can I collect benefits if I become disabled?

Answered: 1 week ago

Question

Question May I set up a Keogh plan in addition to an IRA?

Answered: 1 week ago