A good answer might be:

Recall that for maximum accuracy, the loop control variable should be an integer type. So the modified loop should look like this:
    tenths      = 0 ;
    while (  tenths <= limit*10 )    
    {
      double t = tenths/10.0 ;        // be sure to include "point zero"
      distance = (G * t * t)/2 ;
      System.out.println( t + "\t" + distance );

      tenths = tenths + 1 ;
    }

It is best to leave the formula as it was in the previous program, and to handle the calculation of t from tenths in an extra statement. (Sometimes people try to skip the extra statement by modifying the formula, but this saves little or no computer time, and costs possible confusion and error.)

Rows of Stars

Let us say that you want a program that writes out five rows of stars, such as the following (you are, evidently, easily amused):

*******
*******
*******
*******
*******

This could be done with a while loop that iterates five times (executes its body five times.) Each iteration would use a System.out.println("*******"). But it would be nicer if the user could say how many lines to print, and how many stars to print in each line; something like this:

Lines?
3
Stars per line?
13
*************
*************
*************
This is a harder problem, since the user might ask for any number of stars per line, and no single println will be able to do that.

QUESTION 16:

Can a counting loop, such as we have been using, be used to count through the number of lines requested by the user?

Click Here after you have answered the question