-- A V Peterson 07-03-2001 -- Find the largest square LESS THAN some n -- A slightly different program from the largesquare program class TEST_LOOP creation make feature make is local n : INTEGER i : INTEGER square, prev_square : INTEGER do io.put_string("Find largest square less than? ") io.read_integer; n := io.last_integer from i := 0 square := 0 until square >= n loop prev_square := square i := i + 1 square := i * i -- diagnostic print statements -- io.put_string("square : "); io.put_integer(square) -- io.put_string(" prev_square : "); io.put_integer(prev_square) -- io.put_new_line end -- loop if (n > 0) then io.put_string("Largest square < "); io.put_integer(n) io.put_string(" is "); io.put_integer(prev_square); io.put_new_line end --if end -- make end -- class TEST_LOOP