
-----------------------------------
bushnerd
Thu Feb 09, 2006 6:01 pm

Why wont this loop properly?
-----------------------------------
I am having trouble getting this to loop properly. I want it to loop until they enter a proper time under 4.5 seconds. When I enter it, it just ends the program.

Thanks

import javax.swing.*;

public class height {
	
	public static void main (String[]args) {
		double time, answer;
		String inputStr;
		inputStr = JOptionPane.showInputDialog(null, "Enter a time less then 4.5 seconds");
		time = Double.parseDouble(inputStr);
		while (time >4.5){
		
		if (time 4.5){
      
      if (time 