View Single Post
  #20 (permalink)  
Old 05-07-2008, 03:14 AM
hardwired hardwired is offline
Senior Member
 
Join Date: Jul 2007
Posts: 1,022
hardwired is on a distinguished road
Numbers 6 and 7 in reply #18 can be done in your ProjectDefinition class.
Number 8 is done in the PC class of #16 or in your ProjectController class of #14.
If you display the input data for each trip through the while loop you won't need to use arrays.
The need for an array comes when you want to store/keep_track_of each new ProjectDefinition instance created from/with the info entered during each trip through the while loop.

My problem is changing the controller code to work with it
Code:
public class PC { public static void main(String[] args){ DataAcquisition dataAcqn = new DataAcquisition(); while(user_wants_to_enter_more_data) { // Create another PersonData: String[] data = dataAcqn.getData(); ProjectDefinition person = new ProjectDefinition(data); System.out.println("person = " + person); // show data in JOptionPane(... // check with user for exit_loop/another_round_of_data } } }
Reply With Quote