问题描述
我正在尝试使其看起来像这样,但是具有一个公式,该公式可以计算物体每秒钟掉落的英尺数.
秒距离(以英尺为单位)
0:0
1:16
2:64
3:144
我尝试过的事情:
我下面的这段代码与我上面试图做的类似,除了这段代码将华氏温度计算为摄氏温度.我希望上面的那个看起来像这个的输出,但是上面的信息和一个计算它的公式.我认为其中的公式部分是我遇到的困难.谢谢您的时间.
公共课FahrenheitToCelsius {
公共静态void main(String [] args){
System.out.println(华氏温度到摄氏温度");
for(int华氏= 1;华氏< = 10;华氏+ = 1){
双摄氏=华氏度ToCelsius(华氏);
System.out.println(+ fahrenheit +:" +摄氏度);
}
}
public static double fahrenheitToCelsius(double fahrenheit){
双摄氏= =(华氏-32)* 5/9;
返回摄氏度;
}
}
I am trying to make it look like this, but with a formula that can calculate how far the in feet the an object would fall every one second.
Seconds Distance in feet
0: 0
1: 16
2: 64
3: 144
What I have tried:
I have this code below that is similar to what I am trying to do above except this one calculates Fahrenheit to Celsius. I want the one above to look like the output to this one but with the information above and a formula to calculate it. I think the formula part of it is what I am having difficulty with. Thank you for you time.
public class FahrenheitToCelsius {
public static void main(String[] args) {
System.out.println("Fahrenheit to Celsius temperatures");
for (int fahrenheit = 1; fahrenheit <= 10; fahrenheit += 1) {
double celsius = fahrenheitToCelsius(fahrenheit);
System.out.println(+fahrenheit+": "+celsius);
}
}
public static double fahrenheitToCelsius(double fahrenheit) {
double celsius = (fahrenheit - 32) * 5 / 9;
return celsius;
}
}
推荐答案
d = g * t * t / 2;
其中
-
d
是距离. -
g
是标准重力常数(大约9.81 m/s/s
). -
t
是时间(以秒为单位)秒. d
is the distance.g
is the standard gravity constant (about9.81 m/s/s
).t
is the time in seconds.
Where
这篇关于需要可以计算对象在0、1、2、3、4、5、6、7、8、9、10秒内下落的Java代码.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!