my program cant be resert to ask the user input data again after
while(ans.equalsIgnoreCase("y"); pls somebody can tell me!

Recommended Answers

All 2 Replies

Then put the reading of the temperature inside the do-while.

you must put this inside the loop.

numTemperature = JOptionPane.showInputDialog("Enter temperature:");
number = Integer.parseInt(numTemperature);

then put System.exit();
after the while statement.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.