实现一个函数,当被调用时返回停止距离。 [英] Implement a function that when called returns stopping distance.

查看:63
本文介绍了实现一个函数,当被调用时返回停止距离。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

实现一个函数,当被调用时返回停止距离。

停止距离的公式是

停止距离=(v×t)+ {v²/ [2×g ×(f±G)]}

其中,g =重力(9.8)

v =车速

t =感知时间

f =摩擦系数

G =道路等级

for Uphill(停止距离=(v×t)+ {v²/ [2×g×( f + G)]})
下坡的
(停止距离=(v×t)+ {v²/ [2×g×(f-G)]})

当调用该函数时,它会询问上述变量的值并返回停止距离。



我尝试了什么: < br $> b $ b

我不可能编写代码

Implement a function that when called returns Stopping Distance.
Formula for stopping distance is
Stopping Distance = (v × t) + { v² / [2 × g × ( f±G )] }
Where, g = gravity (9.8)
v = Vehicle Speed
t = perception Time
f= Coefficient of Friction
G= Grade of Road
for Uphill (Stopping Distance = (v × t) + { v² / [2 × g × ( f+G )] } )
for Downhill (Stopping Distance = (v × t) + { v² / [2 × g × ( f - G )] } )
When the function is called, it asks the values of above mentioned variables and returns the stopping distance.

What I have tried:

it is impossible for me to write code

推荐答案

引用:

我不可能编写代码

考虑改变你的研究领域。

这是rea l基本的HomeWork。如果你不可能编写代码,你就会遇到大问题。

Think about changing the domain of your study then.
This is real basic HomeWork. If 'it is impossible for you to write code' you have big problem.


我不可能编写代码

然后你走错路线,你就会失败。



我们不做你的功课:这是有原因的。它就是为了让你思考你被告知的事情,并试着理解它。它也在那里,以便您的导师可以识别您身体虚弱的区域,并将更多的注意力集中在补救措施上。



亲自尝试,你可能会发现它不是和你想的一样困难!



如果遇到具体问题,请询问相关问题,我们会尽力提供帮助。但是我们不会为你做这一切!

我们当然不打算通过你无意试图通过自己的课程来欺骗你。这对你班上的其他人或任何可能根据你的通行证雇用你的人都不公平。
"it is impossible for me to write code"
Then you are on the wrong course, and you will fail it.

We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, you may find it is not as difficult as you think!

If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!
And we certainly aren't going to cheat you through a course you have no intention of trying to pass yourself. That wouldn't be fair on the rest of your class, or anyone who might employ you on the basis of your pass.


我给你看一种为'以恒定速度行驶距离'。我想这只是让你弄清楚如何写出所要求的一个。

I show you a way to write a function for 'travel distance at constant speed'. I suppose it's just enough to make you figure out how to write the requested one.
Travel distance at constant speed = (v x t)
v = constant vehicle speed
t = elapsed time.







double travel_distance(double v, double t)
{
  double distance = v * t;
  return distance;
}


这篇关于实现一个函数,当被调用时返回停止距离。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆