Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The braking distance of a car depends on its speed as the brakes are applied and on the car's braking efficiency. A forumula for the
The braking distance of a car depends on its speed as the brakes are applied and on the car's braking efficiency. A forumula for the braking distance is: b = S2 / 2Rg und where b is the braking distance, s is the car's speed, R is the braking efficiency, and g is the acceleration due to gravity (9.81). Write a script that calls a function to prompt the user fors and R, calls another function to calculate the braking distance, and calls a third function to print the braking distance in a sentence format with one decimal place. You are to write a function stub for the function that prompts fors and R (and set speed = 10 and braking rate = 2), and the actual function definitions for the other two functions. [S, R] = promptSandR; brakDist = calcbd(s, R); printbd (brakDist) The problem says that "a script has been written". Rather than assume the described script, write it yourself so that you can test to see that things are working. The functions specified should all be local functions within this script. The script should use different names for variables than those assumed by the functions. For example, the promptSand function definition might return speed and brate but the script will assign the returned values to the variables s and R. [S, R]=promptsandRO; function (speed, brate] = promptsandR
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started