I instantiated an obj and passed 6 parameters, they were written to a text file with PrintOut method in Write class. Since A to F are private variables, I use get methods to return their values. So, there is a record of 6 data written to a text file. However, after saving this record, I want the console to ask whether the user wants to input additional record? e.g. System.out.println("Do you want to add more record (Y/N)?"); and it got the "y/n" reply from user. I know how to use BufferedReader console = new BufferedReader(new InputStreamReader(System.in)); to get user input.
However, I do not know where should I put the while/do...while loop as the logic is: Ask the user to input the first record; then Ask the user whether he wants to add more record for continuing input; A while loop seems not feasible. Anyone could propose the algorithm? Thanks a lot Andrew