Police Car Cost
Captain Joseph Friday, the police administrator in Port Ormond, would like to estimate the mileage at which a police cruiser should be replaced. Data analyses show that the total operation cost (gas, maintenance, and so on) is approximated by:
c=f=v∗m+s∗m2
where f, v, and s are constant coefficients based on the city, the shifts, and the drivers, and m is the mileage reading (in thousands) on the car’s odometer.
The police department has an arrangement with Generous Motors for trade-ins of used police cruisers. The automaker has agreed to reduce the price of a new cruiser by the following amount:
r=p∗d2
where r is the trade-in value of a used cruiser, p is the original (new) car price, d is a depreciation factor, and m is the mileage (in thousands) as defined above. Assuming the cost of the new car doesn’t change, the depreciation cost of the vehicle is p-r, the difference between the new car price and the trade-in value.
Therefore the total cost of the car is c + (p-r). The cost per a thousand mile is c+p−rm.
Your task is to develop a program in Matlab that determines the mileage (to the nearest 1000 miles) at which cruisers should be replaced, meaning it has the lowest cost per 1000 miles. Prompt the user for values for f, v, s, p, and d (in that order). You should verify that p is greater than 0 and that d is between 0 (not included) and 1 (included). You should then output a table as shown in the sample output below. You should also determine and print out the mileage with the lowest cost per 1000 miles. You may assume that General Motor is not willing to trade in a vehicle past 100,000 miles. The example run is shown below.
The equation for r used here is slightly different from the equation in the question as I have changed d^2 given in the question to d^m which is required to get the answer as given in the example. The matlab script follows..
f=input('Enter the value of f: ');
v=input('Enter the value of v: ');
s=input('Enter the value of s: ');
p=input('Enter the value of p: ');
d=input('Enter the value of d: ');
if p>0 && d>0 && d<=1
for m=1:100
m_value(m)=m;
c(m)=f+(v*m)+(s*m^2)%total operation cost
r(m)=p*(d^(m)); %trade in value. This equation
is slightly different from
%the equation in the question as I have changed
d^2 given in the
%question to d^m which is required to get the
answer as given in the
%example.
dip(m)=p-r(m);%depriciation cost
t(m)=c(m)+p-r(m); %total cost of the car
tm(m)=t(m)/m; %total cost per 1000 miles
end
arra=zeros(m,5);
arra(:,1)=m_value;
arra(:,2)=c;
arra(:,3)=dip;
arra(:,4)=t;
arra(:,5)=tm;
T=array2table(arra,'VariableNames',{'kMiles','Operation','Depiciation','Total','Cost_per_kMiles'})
[tm_min,tm_min_ind]=min(tm);%find min value of cost per 1000
miles and its index;
m_min=m_value(tm_min_ind)*1000;%Find distance with minimum cost per
1000 miles
sprintf('The vehicle should be replaced at %d miles for cost per
kMiles of $ %f', m_min,tm_min)
else
sprintf('Invalid values of p or d')
end
Police Car Cost Captain Joseph Friday, the police administrator in Port Ormond, would like to estimate the mileage at wh...
* This is all the information given QUESTION 1 (iii,iv) PLEASE!!!: Examine the car performance when the angle of both the front and rear wings is set to θ = 10◦. In all the analysis that follows ignore frictional losses other than drag. Determine: (iii) What is the maximum speed the vehicle can safely corner a bend with R = 30 m (ans. 108Km/hr). What is the power required at this speed? (ans. 27.8KW) (iv) What is the maximum speed...
* This is all the information given QUESTION 1 (iii,iv) PLEASE!!!: Examine the car performance when the angle of both the front and rear wings is set to θ = 10◦. In all the analysis that follows ignore frictional losses other than drag. Determine: (iii) What is the maximum speed the vehicle can safely corner a bend with R = 30 m (ans. 108Km/hr). What is the power required at this speed? (ans. 27.8KW) (iv) What is the maximum speed...
Please answer correctly thank you Your answer is partially correct. Bryant Company has a factory machine with a book value of $87.400 and a remaining useful life of 7 years. It can be sold for $29,200. A new machine is available at a cost of $346,000. This machine will have a 7-year useful life with no salvage value. The new machine will lower annual variable manufacturing costs from $622,000 to $565,000. Prepare an analysis showing whether the old machine should...
Roberts Auto Sales and Service (RASAS) consists of three car dealerships that sell and service several makes of American and Japanese cars, two auto parts stores, a large body shop and car painting business, and an auto salvage yard. Vicky Roberts, owner of RASAS, went into the car business when she inherited a Ford dealership from her father. She was able to capitalize on her knowledge and experience to build her business into the diversified and successful mini-empire it is...
You will be writing a simple Java program that implements an ancient form of encryption known as a substitution cipher or a Caesar cipher (after Julius Caesar, who reportedly used it to send messages to his armies) or a shift cipher. In a Caesar cipher, the letters in a message are replaced by the letters of a "shifted" alphabet. So for example if we had a shift of 3 we might have the following replacements: Original alphabet: A B C...