f you copy I would give downvotes. Please I don't need copied code for this question. Please don't make fool.  You guys simply give wrong and illogical answer

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

If you copy I would give downvotes. Please I don't need copied code for this question. Please don't make fool. 

You guys simply give wrong and illogical answer

 

 

 

Displacement, D (i.e. a distance) for a braking vehicle can be calculated with the initial velocity,
I, the final velocity, F, and deceleration, a.
(p2 - P)
= D
(-2 a)
Write a function called displacement that takes as parameters: initial velocity, I, final velocity
F, and deceleration a.
Function specifications:
Your function must be named displacement
• Your function takes three parameters (all double, in this order)
o Initial velocity I
o Final velocity F
o Deceleration a
• Your function should return the appropriate displacement, D, of the vehicle as double. If
one or more values are invalid, the function print all the error messages in this order and
return o.
• If your function receives negative velocities then it must print "velocity should be
greater than zero."
• If your function receives a zero deceleration then it must print "No brakes were
applied."
• If your function receives a negative deceleration then it must print "The vehicle is
speeding up."
• f your function receives F > I then it must print "Error in acceleration
values."
For example: Bob is riding his bicycle to the store at a velocity of 4 m/s, when an aardvark runs
out in front of him. He quickly brakes to a complete stop, with a deceleration of 2 m/s. What is
his displacement?
Note that because Bob is stopped, the final velocity, F = 0. His initial velocity, I = 4 m/s. The
deceleration is 2 m/s.
Therefore the function should return 4.
(0² – 4²)
-
= 4
(-2· 2)
Transcribed Image Text:Displacement, D (i.e. a distance) for a braking vehicle can be calculated with the initial velocity, I, the final velocity, F, and deceleration, a. (p2 - P) = D (-2 a) Write a function called displacement that takes as parameters: initial velocity, I, final velocity F, and deceleration a. Function specifications: Your function must be named displacement • Your function takes three parameters (all double, in this order) o Initial velocity I o Final velocity F o Deceleration a • Your function should return the appropriate displacement, D, of the vehicle as double. If one or more values are invalid, the function print all the error messages in this order and return o. • If your function receives negative velocities then it must print "velocity should be greater than zero." • If your function receives a zero deceleration then it must print "No brakes were applied." • If your function receives a negative deceleration then it must print "The vehicle is speeding up." • f your function receives F > I then it must print "Error in acceleration values." For example: Bob is riding his bicycle to the store at a velocity of 4 m/s, when an aardvark runs out in front of him. He quickly brakes to a complete stop, with a deceleration of 2 m/s. What is his displacement? Note that because Bob is stopped, the final velocity, F = 0. His initial velocity, I = 4 m/s. The deceleration is 2 m/s. Therefore the function should return 4. (0² – 4²) - = 4 (-2· 2)
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY