-2
私はいくつかの計算をしようとしていましたが、何かがかなり足りません。私は 数学計算のためにJAVAループを使用
下のスクリーンショットを達成しようとしていますが、これは、私はいくつかの助けを必要としてください
を得ているものです、これは私がこれまで
public class VelocityFall
{
public static void main (String [] a)
{
Scanner s = new Scanner (System.in);
System.out.print("This program prints a table that shows each \nsecond,"
+
"height from the ground (meters), and the velocity (m/s)\n of a free-falling" +
"object from an initial height (metres).\nPlease input the Initial Height H: ");
// input/get the value of H from the keyboard
double H = s.nextDouble();
// we need to design/output the table by using println with lines and tabs (\t)
System.out.println ("------------------------------------------");
System.out.println (" t(s)\t\tHeight(m)\t\tVelocity(m/s)");
System.out.println ("------------------------------------------");
//we now require a for loop
for (int t = 0; t<=15; t++)
{
// we are now going to calculate and output the velocity and decreasing
height
double velocity = 9.8*t;
H = H-(0.5*9.8*Math.pow(t,2));
System.out.println(t + "\t\t" + H + "\t\t" + velocity);
}
}
}
をやっていることです
私は運動学を取ってからずっと前ですが、前の高さからではなく、最初の高さからHを計算してはいけませんか? –
あなたの質問を編集してより良いフォーマットにすることができますか?あなたがしようとしていることを説明してください*。 「いくつかの計算」は単なるゆるやかな言葉であり、正確な計算は何をしようとしているのか、どの入力とどのように出力が異なるのか、そして非常に重要なことです。それを修正しようとしましたが、それを動作させることに終わったのですか? –