This program is supposed to allow for the user to input any amount of numbers then when they typ stop it will average the numbers given and returned the number. But all it does as of now is not work.
import java.io.*;
public class DontStop{ static String STOP_WORD="stop"; static BufferedReader keyboard=new BufferedReader(new InputStreamReader(System.in)); public static void main(String arg[]) throws IOException { System.out.println("This program calculates the average of numbers entered by the user"); System.out.println("After you have entered your last number, simply type STOP."); doThis(); } public static void doThis()throws IOException { String choiceString = "a"; int choice = 0; int count = 1; double total=0; double average=0; while(!choiceString.equalsIgnoreCase(STOP_WORD)){ System.out.print(" Please enter number "+ count+": "); } if(choiceString.equalsIgnoreCase(STOP_WORD)){ count--; System.out.println ("You entered "+count+" numbers with an average of "+total/count); System.exit(0); }// }