Я пытаюсь выполнить простые вычисления скорости. Но мои коды не будут компилироваться. Я не уверен, что с ним не так. Любая помощь будет мне полезной, поскольку я новичок в Java.Проблемы с компиляцией 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
int H = s.nextInt();
// we need to design/output the table by using println with lines and
tabs (\t)
System.out.println ("------------------------------------------");
System.out.println (" Second\t\tHeight\t\tVelocity");
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
double velocity = Math.sqrt(2*9.8*H);
System.out.println (t++"\t\t"+H"\t\t"+velocity);
}
}
}
Какое сообщение об ошибке? – luk2302
'tabs (\ t)' выглядит очень подозрительно. – Marvin
И, 'System.out.println (t +" \ t \ t "+ H +" \ t \ t "+ velocity);' –