Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q.1 The cost per mile for a rented vehicle is $1.00 for the first 100 miles. S0.80 for the next 200 miles, and $O.70 for

image text in transcribed
image text in transcribed
image text in transcribed
Q.1 The cost per mile for a rented vehicle is $1.00 for the first 100 miles. S0.80 for the next 200 miles, and $O.70 for all miles in excess of 300 miles. Write MATLAB statements that determine the total cost anc the average cost per mile for a given number of miles (stored in vari- able distance). (7 points) Considered distance traveled-450 miles Q.2 (6 points) The distance between two points V z) and (x. y2) in a three- dimensional Cartesian coordinate system is given by the equation d-V(x-2)++(1-2)(2-13) Write a program to calculate the distance between any two points (xy, y z) and (x2y2 2) specified by the user. Use good programming practices in your program. Use the program to calculate the distance between the points (-3, 2, 5) and (3,-6,-5 (7 points) Energy Stored in a Spring The force required to compress a linear spring is given by the equation (2-18) where Fis the foree in newtons and k is the spring constant in newtons per meter. The potential energy stored in the compressed spring is given by the equation (2-19) where E is the energy in joules. The following information is available for four springs Spring Spring 2 Spring 3 Spring 4 Force (N) 20 30 25 20 Spring constant k(N/m) 20 250 300 400 Determine the compression of each spring, and the potential energy stored in each spring. Which spring has the most energy stored in it? Extra credit question Q.4 Variables a, b,c, and d have been initialized to the following values: (5 points) Evaluate the following MATLAB assignment statements (a) output (b) output (c) output (d) output (e) output -a b+c d; a* (b+c)*d; (a*b) + (c*d) ; a*b d; = a"(b"d)

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_2

Step: 3

blur-text-image_3

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

Database 101

Authors: Guy Kawasaki

1st Edition

0938151525, 978-0938151524

More Books

Students also viewed these Databases questions

Question

Determine miller indices of plane A Z a/2 X a/2 a/2 Y

Answered: 1 week ago