Reading the exception that your code throws shows it has trouble converting your double into a '%d'which is a decimal integer. Makes sense, a double isn't an integer.
See
this tutorial from Oracle.
If I replace;
System.out.printf("%4d%2f", equation);
with:
System.out.printf("%.1f ", equation);
It runs as expected for me and gives the result you show in your question.
Hope this helps you. Cheers.
UPDATE:
You can make it look neater with a "fill" method that replaces a String of preset characters(String chr) with an input string (String msg). There are many possibilities, like using a JFrame(window) and a JTable to display the result. But thats for you to try out.
public static void main(String[] args)
{
System.out.println("not actually a title thingy");
System.out.print(" ");
for(int v = 5; v <= 50; v+=5)
System.out.print(" " + "V= " + v);
System.out.println("\n--------------------------------------------------------------------------------------");
for (int t = -20; t <= 40; t+=5)
{
System.out.print( fill("T = " + t + " | "," ") );
for (int v = 5; v <= 50; v+=5)
{
double equation = (35.74 + (0.6215 * t) - (35.75 * Math.pow(v, 0.16)) + (0.4275 * t * Math.pow(v, 0.16)));
String res = String.format("%.1f ", equation);
System.out.printf( fill(res, " ") );
}
System.out.println();
}
}
public static String fill(String msg, String chr)
{
String res = "";
int leng = chr.length();
for (int s=0; s<leng; s++) res += chr;
String concat = msg+res;
return concat.substring(0, leng);
}